6 gcc - GNU project C and C++ compiler
14 .Op Fl std= Ns Ar standard
18 .Op Fl W Ns Ar warn...
22 .Op Fl D Ns Ar macro Ns = Ns Ar defn...
24 .Op Fl f Ns Ar option...
25 .Op Fl m Ns Ar machine-option...
29 Only the most useful options are listed here; see below for the remainder.
31 accepts mostly the same options as
34 When you invoke GCC, it normally does preprocessing, compilation, assembly and linking.
35 The "overall options" allow you to stop this process at an intermediate stage.
38 option says not to run the linker.
39 Then the output consists of object files output by the assembler.
41 Other options are passed on to one stage of processing.
42 Some options control the preprocessor and others the compiler itself.
43 Yet other options control the assembler and linker; most of these are not documented here, since you rarely need to use any of them.
45 Most of the command line options that you can use with GCC are useful for C programs; when an option is only useful with another language (usually C++), the explanation says so explicitly.
46 If the description for a particular option does not mention a source language, you can use that option with all supported languages.
50 program accepts options and file names as operands.
51 Many options have multi-letter names; therefore multiple single-letter options may
55 is very different from
58 You can mix options and other arguments.
59 For the most part, the order you use doesn't matter.
60 Order does matter when you use several options of the same kind; for example, if you specify
62 more than once, the directories are searched in the order specified.
64 Many options have long names starting with
69 .Fl fstrength-reduce ,
72 Most of these have both positive and negative forms; the negative form of
76 This manual documents only one of these two forms, whichever one is not the default.
79 Here is a summary of all the options, grouped by type.
80 Explanations are in the following sections.
83 .It Sy Overall Options
84 .Fl c Fl S Fl E Fl o Ar file
85 .Fl combine Fl pipe Fl pass-exit-codes Fl x Ar language
86 .Fl v Fl ### Fl -help Fl -target-help Fl -version
88 .It Sy C Language Options
89 .Fl ansi Fl std= Ns Ar standard
90 .Fl fgnu89-inline Fl aux-info Ar filename
91 .Fl fno-asm Fl fno-builtin Fl fno-builtin- Ns Ar function
92 .Fl fhosted Fl ffreestanding Fl fms-extensions Fl trigraphs Fl no-integrated-cpp Fl traditional Fl traditional-cpp Fl fallow-single-precision Fl fcond-mismatch Fl fsigned-bitfields Fl fsigned-char Fl funsigned-bitfields Fl funsigned-char
94 .It Sy C++ Language Options
95 .Fl fabi-version= Ns Ar n
96 .Fl fno-access-control Fl fcheck-new Fl fconserve-space Fl ffriend-injection Fl fno-const-strings Fl fno-elide-constructors Fl fno-enforce-eh-specs Fl ffor-scope Fl fno-for-scope Fl fno-gnu-keywords Fl fno-implicit-templates Fl fno-implicit-inline-templates Fl fno-implement-inlines Fl fms-extensions Fl fno-nonansi-builtins Fl fno-operator-names Fl fno-optional-diags Fl fpermissive Fl frepo Fl fno-rtti Fl fstats Fl ftemplate-depth- Ns Ar n
97 .Fl fno-threadsafe-statics Fl fuse-cxa-atexit Fl fno-weak Fl nostdinc++ Fl fno-default-inline Fl fvisibility-inlines-hidden Fl Wabi Fl Wctor-dtor-privacy Fl Wnon-virtual-dtor Fl Wreorder Fl Weffc++ Fl Wno-deprecated Fl Wstrict-null-sentinel Fl Wno-non-template-friend Fl Wold-style-cast Fl Woverloaded-virtual Fl Wno-pmf-conversions Fl Wsign-promo
99 .It Sy Objective-C and Objective-C++ Language Options
100 .Fl fconstant-string-class= Ns Ar class-name
101 .Fl fgnu-runtime Fl fnext-runtime Fl fno-nil-receivers Fl fobjc-call-cxx-cdtors Fl fobjc-direct-dispatch Fl fobjc-exceptions Fl fobjc-gc Fl freplace-objc-classes Fl fzero-link Fl gen-decls Fl Wassign-intercept Fl Wno-protocol Fl Wselector Fl Wstrict-selector-match Fl Wundeclared-selector
103 .It Sy Language Independent Options
104 .Fl fmessage-length= Ns Ar n
105 .Fl fdiagnostics-show-location= Ns Oo Ns Ar once Ns | Ns Ar every-line Ns Oc
106 .Fl fdiagnostics-show-options
108 .It Sy Warning Options
109 .Fl fsyntax-only Fl pedantic Fl pedantic-errors Fl w Fl Wextra Fl Wall Fl Waggregate-return Fl Wno-attributes Fl Wc++-compat Fl Wcast-align Fl Wcast-qual Fl Wchar-subscripts Fl Wcomment Fl Wconversion Fl Wno-deprecated-declarations Fl Wdisabled-optimization Fl Wno-div-by-zero Fl Wno-endif-labels Fl Werror Fl Werror-implicit-function-declaration Fl Wfatal-errors Fl Wfloat-equal Fl Wformat Fl Wformat=2 Fl Wno-format-extra-args Fl Wformat-nonliteral Fl Wformat-security Fl Wformat-y2k Fl Wimplicit Fl Wimplicit-function-declaration Fl Wimplicit-int Fl Wimport Fl Wno-import Fl Winit-self Fl Winline Fl Wno-int-to-pointer-cast Fl Wno-invalid-offsetof Fl Winvalid-pch Fl Wlarger-than- Ns Ar len
110 .Fl Wunsafe-loop-optimizations Fl Wlong-long Fl Wmain Fl Wmissing-braces Fl Wmissing-field-initializers Fl Wmissing-format-attribute Fl Wmissing-include-dirs Fl Wmissing-noreturn Fl Wno-multichar Fl Wnonnull Fl Wpacked Fl Wpadded Fl Wparentheses Fl Wpointer-arith Fl Wno-pointer-to-int-cast Fl Wredundant-decls Fl Wreturn-type Fl Wsequence-point Fl Wshadow Fl Wsign-compare Fl Wstack-protector Fl Wstrict-aliasing Fl Wstrict-aliasing=2 Fl Wswitch Fl Wswitch-default Fl Wswitch-enum Fl Wsystem-headers Fl Wtrigraphs Fl Wundef Fl Wuninitialized Fl Wunknown-pragmas Fl Wno-pragmas Fl Wunreachable-code Fl Wunused Fl Wunused-function Fl Wunused-label Fl Wunused-parameter Fl Wunused-value Fl Wunused-variable Fl Wvariadic-macros Fl Wvolatile-register-var Fl Wwrite-strings
112 .It Sy C-only Warning Options
113 .Fl Wbad-function-cast Fl Wmissing-declarations Fl Wmissing-prototypes Fl Wnested-externs Fl Wold-style-definition Fl Wstrict-prototypes Fl Wtraditional Fl Wdeclaration-after-statement Fl Wpointer-sign
115 .It Sy Debugging Options
117 .Fl dumpspecs Fl dumpmachine Fl dumpversion Fl fdump-unnumbered Fl fdump-translation-unit- Ns Ar n
118 .Fl fdump-class-hierarchy- Ns Ar n
119 .Fl fdump-ipa-all Fl fdump-ipa-cgraph Fl fdump-tree-all Fl fdump-tree-original- Ns Ar n
120 .Fl fdump-tree-optimized- Ns Ar n
121 .Fl fdump-tree-inlined- Ns Ar n
122 .Fl fdump-tree-cfg Fl fdump-tree-vcg Fl fdump-tree-alias Fl fdump-tree-ch Fl fdump-tree-ssa- Ns Ar n
123 .Fl fdump-tree-pre- Ns Ar n
124 .Fl fdump-tree-ccp- Ns Ar n
125 .Fl fdump-tree-dce- Ns Ar n
126 .Fl fdump-tree-gimple Ns Oo Ns Ar -raw Ns Oc
127 .Fl fdump-tree-mudflap- Ns Ar n
128 .Fl fdump-tree-dom- Ns Ar n
129 .Fl fdump-tree-dse- Ns Ar n
130 .Fl fdump-tree-phiopt- Ns Ar n
131 .Fl fdump-tree-forwprop- Ns Ar n
132 .Fl fdump-tree-copyrename- Ns Ar n
133 .Fl fdump-tree-nrv Fl fdump-tree-vect Fl fdump-tree-sink Fl fdump-tree-sra- Ns Ar n
134 .Fl fdump-tree-salias Fl fdump-tree-fre- Ns Ar n
135 .Fl fdump-tree-vrp- Ns Ar n
136 .Fl ftree-vectorizer-verbose= Ns Ar n
137 .Fl fdump-tree-storeccp- Ns Ar n
138 .Fl feliminate-dwarf2-dups Fl feliminate-unused-debug-types Fl feliminate-unused-debug-symbols Fl fmem-report Fl fprofile-arcs Fl frandom-seed= Ns Ar string
139 .Fl fsched-verbose= Ns Ar n
140 .Fl ftest-coverage Fl ftime-report Fl fvar-tracking Fl g Fl g Ns Ar level
141 .Fl gcoff Fl gdwarf-2 Fl ggdb Fl gstabs Fl gstabs+ Fl gvms Fl gxcoff Fl gxcoff+ Fl p Fl pg Fl print-file-name= Ns Ar library
142 .Fl print-libgcc-file-name Fl print-multi-directory Fl print-multi-lib Fl print-prog-name= Ns Ar program
143 .Fl print-search-dirs Fl Q Fl save-temps Fl time
145 .It Sy Optimization Options
146 .Fl falign-functions Ns Oo = Ns Ar n Oc
147 .Fl falign-jumps Ns Oo = Ns Ar n Oc
148 .Fl falign-labels Ns Oo = Ns Ar n Oc
149 .Fl falign-loops Ns Oo = Ns Ar n Oc
150 .Fl fmudflap Fl fmudflapth Fl fmudflapir Fl fbranch-probabilities Fl fprofile-values Fl fvpt Fl fbranch-target-load-optimize Fl fbranch-target-load-optimize2 Fl fbtr-bb-exclusive Fl fcaller-saves Fl fcprop-registers Fl fcse-follow-jumps Fl fcse-skip-blocks Fl fcx-limited-range Fl fdata-sections Fl fdelayed-branch Fl fdelete-null-pointer-checks Fl fearly-inlining Fl fexpensive-optimizations Fl ffast-math Fl ffloat-store Fl fforce-addr Fl ffunction-sections Fl fgcse Fl fgcse-lm Fl fgcse-sm Fl fgcse-las Fl fgcse-after-reload Fl floop-optimize Fl fcrossjumping Fl fif-conversion Fl fif-conversion2 Fl finline-functions Fl finline-functions-called-once Fl finline-limit= Ns Ar n
151 .Fl fkeep-inline-functions Fl fkeep-static-consts Fl fmerge-constants Fl fmerge-all-constants Fl fmodulo-sched Fl fno-branch-count-reg Fl fno-default-inline Fl fno-defer-pop Fl floop-optimize2 Fl fmove-loop-invariants Fl fno-function-cse Fl fno-guess-branch-probability Fl fno-inline Fl fno-math-errno Fl fno-peephole Fl fno-peephole2 Fl funsafe-math-optimizations Fl funsafe-loop-optimizations Fl ffinite-math-only Fl fno-trapping-math Fl fno-zero-initialized-in-bss Fl fomit-frame-pointer Fl foptimize-register-move Fl foptimize-sibling-calls Fl fprefetch-loop-arrays Fl fprofile-generate Fl fprofile-use Fl fregmove Fl frename-registers Fl freorder-blocks Fl freorder-blocks-and-partition Fl freorder-functions Fl frerun-cse-after-loop Fl frerun-loop-opt Fl frounding-math Fl fschedule-insns Fl fschedule-insns2 Fl fno-sched-interblock Fl fno-sched-spec Fl fsched-spec-load Fl fsched-spec-load-dangerous Fl fsched-stalled-insns Ns Oo = Ns Ar n Oc
152 .Fl fsched-stalled-insns-dep Ns Oo = Ns Ar n Oc
153 .Fl fsched2-use-superblocks Fl fsched2-use-traces Fl freschedule-modulo-scheduled-loops Fl fsignaling-nans Fl fsingle-precision-constant Fl fstack-protector Fl fstack-protector-all Fl fstrength-reduce Fl fstrict-aliasing Fl ftracer Fl fthread-jumps Fl funroll-all-loops Fl funroll-loops Fl fpeel-loops Fl fsplit-ivs-in-unroller Fl funswitch-loops Fl fvariable-expansion-in-unroller Fl ftree-pre Fl ftree-ccp Fl ftree-dce Fl ftree-loop-optimize Fl ftree-loop-linear Fl ftree-loop-im Fl ftree-loop-ivcanon Fl fivopts Fl ftree-dominator-opts Fl ftree-dse Fl ftree-copyrename Fl ftree-sink Fl ftree-ch Fl ftree-sra Fl ftree-ter Fl ftree-lrs Fl ftree-fre Fl ftree-vectorize Fl ftree-vect-loop-version Fl ftree-salias Fl fweb Fl ftree-copy-prop Fl ftree-store-ccp Fl ftree-store-copy-prop Fl ftree-vrp Fl funit-at-a-time Fl fwhole-program Fl -param Ar name Ns = Ns Ar value
154 .Fl O Fl O0 Fl O1 Fl O2 Fl O3 Fl \&Os
156 .It Sy Preprocessor Options
157 .Fl A Ns Ar question Ns = Ns Ar answer
158 .Fl A- Ns Ar question Ns = Ns Ar answer
159 .Fl C Fl dD Fl dI Fl dM Fl dN Fl D Ns Ar macro Ns = Ns Ar defn
160 .Fl E Fl H Fl idirafter Ar dir
164 .Fl iwithprefix Ar dir
165 .Fl iwithprefixbefore Ar dir
167 .Fl cxx-isystem Ar dir
169 .Fl M Fl MM Fl MF Fl MG Fl MP Fl MQ Fl MT Fl nostdinc Fl P Fl fworking-directory Fl remap Fl trigraphs Fl undef Fl U Ns Ar macro
171 .Fl Xpreprocessor Ar option
173 .It Sy Assembler Option
175 .Fl Xassembler Ar option
177 .It Sy Linker Options
180 .Fl nostartfiles Fl nodefaultlibs Fl nostdlib Fl pie Fl rdynamic Fl s Fl static Fl static-libgcc Fl shared Fl shared-libgcc Fl symbolic Fl Wl, Ns Ar option
181 .Fl Xlinker Ar option
184 .It Sy Directory Options
189 .Fl specs= Ns Ar file
190 .Fl I- Fl -sysroot= Ns Ar dir
192 .It Sy Target Options
196 .It Sy Machine Dependent Options
198 .Fl EB Fl EL Fl mmangle-cpu Fl mcpu= Ns Ar cpu
199 .Fl mtext= Ns Ar text-section
200 .Fl mdata= Ns Ar data-section
201 .Fl mrodata= Ns Ar readonly-data-section
204 .Fl mapcs-frame Fl mno-apcs-frame Fl mabi= Ns Ar name
205 .Fl mapcs-stack-check Fl mno-apcs-stack-check Fl mapcs-float Fl mno-apcs-float Fl mapcs-reentrant Fl mno-apcs-reentrant Fl msched-prolog Fl mno-sched-prolog Fl mlittle-endian Fl mbig-endian Fl mwords-little-endian Fl mfloat-abi= Ns Ar name
206 .Fl msoft-float Fl mhard-float Fl mfpe Fl mthumb-interwork Fl mno-thumb-interwork Fl mcpu= Ns Ar name
207 .Fl march= Ns Ar name
209 .Fl mstructure-size-boundary= Ns Ar n
210 .Fl mabort-on-noreturn Fl mlong-calls Fl mno-long-calls Fl msingle-pic-base Fl mno-single-pic-base Fl mpic-register= Ns Ar reg
211 .Fl mnop-fun-dllimport Fl mcirrus-fix-invalid-insns Fl mno-cirrus-fix-invalid-insns Fl mpoke-function-name Fl mthumb Fl marm Fl mtpcs-frame Fl mtpcs-leaf-frame Fl mcaller-super-interworking Fl mcallee-super-interworking Fl mtp= Ns Ar name
215 .Fl msize Fl minit-stack= Ns Ar n
216 .Fl mno-interrupts Fl mcall-prologues Fl mno-tablejump Fl mtiny-stack Fl mint8
219 .Fl momit-leaf-frame-pointer Fl mno-omit-leaf-frame-pointer Fl mspecld-anomaly Fl mno-specld-anomaly Fl mcsync-anomaly Fl mno-csync-anomaly Fl mlow-64k Fl mno-low64k Fl mid-shared-library Fl mno-id-shared-library Fl mshared-library-id= Ns Ar n
220 .Fl mlong-calls Fl mno-long-calls
226 .Fl mmax-stack-frame= Ns Ar n
227 .Fl melinux-stacksize= Ns Ar n
228 .Fl metrax4 Fl metrax100 Fl mpdebug Fl mcc-init Fl mno-side-effects Fl mstack-align Fl mdata-align Fl mconst-align Fl m32-bit Fl m16-bit Fl m8-bit Fl mno-prologue-epilogue Fl mno-gotplt Fl melf Fl maout Fl melinux Fl mlinux Fl sim Fl sim2 Fl mmul-bug-workaround Fl mno-mul-bug-workaround
231 .Fl mmac Fl mpush-args
234 .Fl all_load Fl allowable_client Fl arch Fl arch_errors_fatal Fl arch_only Fl bind_at_load Fl bundle Fl bundle_loader Fl client_name Fl compatibility_version Fl current_version Fl dead_strip Fl dependency-file Fl dylib_file Fl dylinker_install_name Fl dynamic Fl dynamiclib Fl exported_symbols_list Fl filelist Fl flat_namespace Fl force_cpusubtype_ALL Fl force_flat_namespace Fl headerpad_max_install_names Fl image_base Fl init Fl install_name Fl keep_private_externs Fl multi_module Fl multiply_defined Fl multiply_defined_unused Fl noall_load Fl no_dead_strip_inits_and_terms Fl nofixprebinding Fl nomultidefs Fl noprebind Fl noseglinkedit Fl pagezero_size Fl prebind Fl prebind_all_twolevel_modules Fl private_bundle Fl read_only_relocs Fl sectalign Fl sectobjectsymbols Fl whyload Fl seg1addr Fl sectcreate Fl sectobjectsymbols Fl sectorder Fl segaddr Fl segs_read_only_addr Fl segs_read_write_addr Fl seg_addr_table Fl seg_addr_table_filename Fl seglinkedit Fl segprot Fl segs_read_only_addr Fl segs_read_write_addr Fl single_module Fl static Fl sub_library Fl sub_umbrella Fl twolevel_namespace Fl umbrella Fl undefined Fl unexported_symbols_list Fl weak_reference_mismatches Fl whatsloaded Fl F Fl gused Fl gfull Fl mmacosx-version-min= Ns Ar version
237 .Em DEC Alpha Options
238 .Fl mno-fp-regs Fl msoft-float Fl malpha-as Fl mgas Fl mieee Fl mieee-with-inexact Fl mieee-conformant Fl mfp-trap-mode= Ns Ar mode
239 .Fl mfp-rounding-mode= Ns Ar mode
240 .Fl mtrap-precision= Ns Ar mode
241 .Fl mbuild-constants Fl mcpu= Ns Ar cpu-type
242 .Fl mtune= Ns Ar cpu-type
243 .Fl mbwx Fl mmax Fl mfix Fl mcix Fl mfloat-vax Fl mfloat-ieee Fl mexplicit-relocs Fl msmall-data Fl mlarge-data Fl msmall-text Fl mlarge-text Fl mmemory-latency= Ns Ar time
245 .Em DEC Alpha/VMS Options
246 .Fl mvms-return-codes
249 .Fl mgpr-32 Fl mgpr-64 Fl mfpr-32 Fl mfpr-64 Fl mhard-float Fl msoft-float Fl malloc-cc Fl mfixed-cc Fl mdword Fl mno-dword Fl mdouble Fl mno-double Fl mmedia Fl mno-media Fl mmuladd Fl mno-muladd Fl mfdpic Fl minline-plt Fl mgprel-ro Fl multilib-library-pic Fl mlinked-fp Fl mlong-calls Fl malign-labels Fl mlibrary-pic Fl macc-4 Fl macc-8 Fl mpack Fl mno-pack Fl mno-eflags Fl mcond-move Fl mno-cond-move Fl moptimize-membar Fl mno-optimize-membar Fl mscc Fl mno-scc Fl mcond-exec Fl mno-cond-exec Fl mvliw-branch Fl mno-vliw-branch Fl mmulti-cond-exec Fl mno-multi-cond-exec Fl mnested-cond-exec Fl mno-nested-cond-exec Fl mtomcat-stats Fl mTLS Fl mtls Fl mcpu= Ns Ar cpu
252 .Fl mrelax Fl mh Fl ms Fl mn Fl mint32 Fl malign-300
255 .Fl march= Ns Ar architecture-type
256 .Fl mbig-switch Fl mdisable-fpregs Fl mdisable-indexing Fl mfast-indirect-calls Fl mgas Fl mgnu-ld Fl mhp-ld Fl mfixed-range= Ns Ar register-range
257 .Fl mjump-in-delay Fl mlinker-opt Fl mlong-calls Fl mlong-load-store Fl mno-big-switch Fl mno-disable-fpregs Fl mno-disable-indexing Fl mno-fast-indirect-calls Fl mno-gas Fl mno-jump-in-delay Fl mno-long-load-store Fl mno-portable-runtime Fl mno-soft-float Fl mno-space-regs Fl msoft-float Fl mpa-risc-1-0 Fl mpa-risc-1-1 Fl mpa-risc-2-0 Fl mportable-runtime Fl mschedule= Ns Ar cpu-type
258 .Fl mspace-regs Fl msio Fl mwsio Fl munix= Ns Ar unix-std
259 .Fl nolibdld Fl static Fl threads
261 .Em i386 and x86-64 Options
262 .Fl mtune= Ns Ar cpu-type
263 .Fl march= Ns Ar cpu-type
264 .Fl mfpmath= Ns Ar unit
265 .Fl masm= Ns Ar dialect
266 .Fl mno-fancy-math-387 Fl mno-fp-ret-in-387 Fl msoft-float Fl msvr3-shlib Fl mno-wide-multiply Fl mrtd Fl malign-double Fl mpreferred-stack-boundary= Ns Ar num
267 .Fl mmmx Fl msse Fl msse2 Fl msse3 Fl m3dnow Fl mthreads Fl mno-align-stringops Fl minline-all-stringops Fl mpush-args Fl maccumulate-outgoing-args Fl m128bit-long-double Fl m96bit-long-double Fl mregparm= Ns Ar num
268 .Fl msseregparm Fl momit-leaf-frame-pointer Fl mno-red-zone Fl mno-tls-direct-seg-refs Fl mcmodel= Ns Ar code-model
269 .Fl m32 Fl m64 Fl mlarge-data-threshold= Ns Ar num
272 .Fl mbig-endian Fl mlittle-endian Fl mgnu-as Fl mgnu-ld Fl mno-pic Fl mvolatile-asm-stop Fl mregister-names Fl mno-sdata Fl mconstant-gp Fl mauto-pic Fl minline-float-divide-min-latency Fl minline-float-divide-max-throughput Fl minline-int-divide-min-latency Fl minline-int-divide-max-throughput Fl minline-sqrt-min-latency Fl minline-sqrt-max-throughput Fl mno-dwarf2-asm Fl mearly-stop-bits Fl mfixed-range= Ns Ar register-range
273 .Fl mtls-size= Ns Ar tls-size
274 .Fl mtune= Ns Ar cpu-type
275 .Fl mt Fl pthread Fl milp32 Fl mlp64
278 .Fl m32r2 Fl m32rx Fl m32r Fl mdebug Fl malign-loops Fl mno-align-loops Fl missue-rate= Ns Ar number
279 .Fl mbranch-cost= Ns Ar number
280 .Fl mmodel= Ns Ar code-size-model-type
281 .Fl msdata= Ns Ar sdata-type
282 .Fl mno-flush-func Fl mflush-func= Ns Ar name
283 .Fl mno-flush-trap Fl mflush-trap= Ns Ar number
288 .Fl msim Fl memregs= Ns Ar number
291 .Fl m68000 Fl m68020 Fl m68020-40 Fl m68020-60 Fl m68030 Fl m68040 Fl m68060 Fl mcpu32 Fl m5200 Fl m68881 Fl mbitfield Fl mc68000 Fl mc68020 Fl mnobitfield Fl mrtd Fl mshort Fl msoft-float Fl mpcrel Fl malign-int Fl mstrict-align Fl msep-data Fl mno-sep-data Fl mshared-library-id=n Fl mid-shared-library Fl mno-id-shared-library
294 .Fl m6811 Fl m6812 Fl m68hc11 Fl m68hc12 Fl m68hcs12 Fl mauto-incdec Fl minmax Fl mlong-calls Fl mshort Fl msoft-reg-count= Ns Ar count
297 .Fl mhardlit Fl mno-hardlit Fl mdiv Fl mno-div Fl mrelax-immediates Fl mno-relax-immediates Fl mwide-bitfields Fl mno-wide-bitfields Fl m4byte-functions Fl mno-4byte-functions Fl mcallgraph-data Fl mno-callgraph-data Fl mslow-bytes Fl mno-slow-bytes Fl mno-lsim Fl mlittle-endian Fl mbig-endian Fl m210 Fl m340 Fl mstack-increment
300 .Fl EL Fl EB Fl march= Ns Ar arch
301 .Fl mtune= Ns Ar arch
302 .Fl mips1 Fl mips2 Fl mips3 Fl mips4 Fl mips32 Fl mips32r2 Fl mips64 Fl mips16 Fl mno-mips16 Fl mabi= Ns Ar abi
303 .Fl mabicalls Fl mno-abicalls Fl mxgot Fl mno-xgot Fl mgp32 Fl mgp64 Fl mfp32 Fl mfp64 Fl mhard-float Fl msoft-float Fl msingle-float Fl mdouble-float Fl mdsp Fl mpaired-single Fl mips3d Fl mlong64 Fl mlong32 Fl msym32 Fl mno-sym32 Fl G Ns Ar num
304 .Fl membedded-data Fl mno-embedded-data Fl muninit-const-in-rodata Fl mno-uninit-const-in-rodata Fl msplit-addresses Fl mno-split-addresses Fl mexplicit-relocs Fl mno-explicit-relocs Fl mcheck-zero-division Fl mno-check-zero-division Fl mdivide-traps Fl mdivide-breaks Fl mmemcpy Fl mno-memcpy Fl mlong-calls Fl mno-long-calls Fl mmad Fl mno-mad Fl mfused-madd Fl mno-fused-madd Fl nocpp Fl mfix-r4000 Fl mno-fix-r4000 Fl mfix-r4400 Fl mno-fix-r4400 Fl mfix-vr4120 Fl mno-fix-vr4120 Fl mfix-vr4130 Fl mfix-sb1 Fl mno-fix-sb1 Fl mflush-func= Ns Ar func
305 .Fl mno-flush-func Fl mbranch-likely Fl mno-branch-likely Fl mfp-exceptions Fl mno-fp-exceptions Fl mvr4130-align Fl mno-vr4130-align
308 .Fl mlibfuncs Fl mno-libfuncs Fl mepsilon Fl mno-epsilon Fl mabi=gnu Fl mabi=mmixware Fl mzero-extend Fl mknuthdiv Fl mtoplevel-symbols Fl melf Fl mbranch-predict Fl mno-branch-predict Fl mbase-addresses Fl mno-base-addresses Fl msingle-exit Fl mno-single-exit
311 .Fl mmult-bug Fl mno-mult-bug Fl mam33 Fl mno-am33 Fl mam33-2 Fl mno-am33-2 Fl mreturn-pointer-on-d0 Fl mno-crt0 Fl mrelax
314 .Fl mno-crt0 Fl mbacc Fl msim Fl march= Ns Ar cpu-type
318 .Fl mfpu Fl msoft-float Fl mac0 Fl mno-ac0 Fl m40 Fl m45 Fl m10 Fl mbcopy Fl mbcopy-builtin Fl mint32 Fl mno-int16 Fl mint16 Fl mno-int32 Fl mfloat32 Fl mno-float64 Fl mfloat64 Fl mno-float32 Fl mabshi Fl mno-abshi Fl mbranch-expensive Fl mbranch-cheap Fl msplit Fl mno-split Fl munix-asm Fl mdec-asm
321 See RS/6000 and PowerPC Options.
323 .Em RS/6000 and PowerPC Options
324 .Fl mcpu= Ns Ar cpu-type
325 .Fl mtune= Ns Ar cpu-type
326 .Fl mpower Fl mno-power Fl mpower2 Fl mno-power2 Fl mpowerpc Fl mpowerpc64 Fl mno-powerpc Fl maltivec Fl mno-altivec Fl mpowerpc-gpopt Fl mno-powerpc-gpopt Fl mpowerpc-gfxopt Fl mno-powerpc-gfxopt Fl mmfcrf Fl mno-mfcrf Fl mpopcntb Fl mno-popcntb Fl mfprnd Fl mno-fprnd Fl mnew-mnemonics Fl mold-mnemonics Fl mfull-toc Fl mminimal-toc Fl mno-fp-in-toc Fl mno-sum-in-toc Fl m64 Fl m32 Fl mxl-compat Fl mno-xl-compat Fl mpe Fl malign-power Fl malign-natural Fl msoft-float Fl mhard-float Fl mmultiple Fl mno-multiple Fl mstring Fl mno-string Fl mupdate Fl mno-update Fl mfused-madd Fl mno-fused-madd Fl mbit-align Fl mno-bit-align Fl mstrict-align Fl mno-strict-align Fl mrelocatable Fl mno-relocatable Fl mrelocatable-lib Fl mno-relocatable-lib Fl mtoc Fl mno-toc Fl mlittle Fl mlittle-endian Fl mbig Fl mbig-endian Fl mdynamic-no-pic Fl maltivec Fl mswdiv Fl mprioritize-restricted-insns= Ns Ar priority
327 .Fl msched-costly-dep= Ns Ar dependence_type
328 .Fl minsert-sched-nops= Ns Ar scheme
329 .Fl mcall-sysv Fl mcall-netbsd Fl maix-struct-return Fl msvr4-struct-return Fl mabi= Ns Ar abi-type
330 .Fl msecure-plt Fl mbss-plt Fl misel Fl mno-isel Fl misel=yes Fl misel=no Fl mspe Fl mno-spe Fl mspe=yes Fl mspe=no Fl mvrsave Fl mno-vrsave Fl mfloat-gprs=yes Fl mfloat-gprs=no Fl mfloat-gprs=single Fl mfloat-gprs=double Fl mprototype Fl mno-prototype Fl msim Fl mmvme Fl mads Fl myellowknife Fl memb Fl msdata Fl msdata= Ns Ar opt
331 .Fl mvxworks Fl mwindiss Fl G Ar num
334 .Em S/390 and zSeries Options
335 .Fl mtune= Ns Ar cpu-type
336 .Fl march= Ns Ar cpu-type
337 .Fl mhard-float Fl msoft-float Fl mlong-double-64 Fl mlong-double-128 Fl mbackchain Fl mno-backchain Fl mpacked-stack Fl mno-packed-stack Fl msmall-exec Fl mno-small-exec Fl mmvcle Fl mno-mvcle Fl m64 Fl m31 Fl mdebug Fl mno-debug Fl mesa Fl mzarch Fl mtpf-trace Fl mno-tpf-trace Fl mfused-madd Fl mno-fused-madd Fl mwarn-framesize Fl mwarn-dynamicstack Fl mstack-size Fl mstack-guard
340 .Fl m1 Fl m2 Fl m2e Fl m3 Fl m3e Fl m4-nofpu Fl m4-single-only Fl m4-single Fl m4 Fl m4a-nofpu Fl m4a-single-only Fl m4a-single Fl m4a Fl m4al Fl m5-64media Fl m5-64media-nofpu Fl m5-32media Fl m5-32media-nofpu Fl m5-compact Fl m5-compact-nofpu Fl mb Fl ml Fl mdalign Fl mrelax Fl mbigtable Fl mfmovd Fl mhitachi Fl mrenesas Fl mno-renesas Fl mnomacsave Fl mieee Fl misize Fl mpadstruct Fl mspace Fl mprefergot Fl musermode Fl multcost= Ns Ar number
341 .Fl mdiv= Ns Ar strategy
342 .Fl mdivsi3_libfunc= Ns Ar name
343 .Fl madjust-unroll Fl mindexed-addressing Fl mgettrcost= Ns Ar number
344 .Fl mpt-fixed Fl minvalid-symbols
347 .Fl mcpu= Ns Ar cpu-type
348 .Fl mtune= Ns Ar cpu-type
349 .Fl mcmodel= Ns Ar code-model
350 .Fl m32 Fl m64 Fl mapp-regs Fl mno-app-regs Fl mfaster-structs Fl mno-faster-structs Fl mfpu Fl mno-fpu Fl mhard-float Fl msoft-float Fl mhard-quad-float Fl msoft-quad-float Fl mimpure-text Fl mno-impure-text Fl mlittle-endian Fl mstack-bias Fl mno-stack-bias Fl munaligned-doubles Fl mno-unaligned-doubles Fl mv8plus Fl mno-v8plus Fl mvis Fl mno-vis Fl threads Fl pthreads Fl pthread
353 .Fl Qy Fl Qn Fl YP, Ns Ar paths
356 .Em TMS320C3x/C4x Options
358 .Fl mbig Fl msmall Fl mregparm Fl mmemparm Fl mfast-fix Fl mmpyi Fl mbk Fl mti Fl mdp-isr-reload Fl mrpts= Ns Ar count
359 .Fl mrptb Fl mdb Fl mloop-unsigned Fl mparallel-insns Fl mparallel-mpy Fl mpreserve-float
362 .Fl mlong-calls Fl mno-long-calls Fl mep Fl mno-ep Fl mprolog-function Fl mno-prolog-function Fl mspace Fl mtda= Ns Ar n
365 .Fl mapp-regs Fl mno-app-regs Fl mdisable-callt Fl mno-disable-callt Fl mv850e1 Fl mv850e Fl mv850 Fl mbig-switch
368 .Fl mg Fl mgnu Fl munix
371 See i386 and x86-64 Options.
373 .Em Xstormy16 Options
377 .Fl mconst16 Fl mno-const16 Fl mfused-madd Fl mno-fused-madd Fl mtext-section-literals Fl mno-text-section-literals Fl mtarget-align Fl mno-target-align Fl mlongcalls Fl mno-longcalls
380 See S/390 and zSeries Options.
382 .It Sy Code Generation Options
383 .Fl fcall-saved- Ns Ar reg
384 .Fl fcall-used- Ns Ar reg
385 .Fl ffixed- Ns Ar reg
386 .Fl fexceptions Fl fnon-call-exceptions Fl funwind-tables Fl fasynchronous-unwind-tables Fl finhibit-size-directive Fl finstrument-functions Fl fno-common Fl fno-ident Fl fpcc-struct-return Fl fpic Fl fPIC Fl fpie Fl fPIE Fl fno-jump-tables Fl freg-struct-return Fl fshared-data Fl fshort-enums Fl fshort-double Fl fshort-wchar Fl fverbose-asm Fl fpack-struct Ns Oo = Ns Ar n Oc
387 .Fl fstack-check Fl fstack-limit-register= Ns Ar reg
388 .Fl fstack-limit-symbol= Ns Ar sym
389 .Fl fno-stack-limit Fl fargument-alias Fl fargument-noalias Fl fargument-noalias-global Fl fleading-underscore Fl ftls-model= Ns Ar model
390 .Fl ftrapv Fl fwrapv Fl fbounds-check Fl fvisibility
393 .Ss Options Controlling the Kind of Output
394 Compilation can involve up to four stages: preprocessing, compilation proper, assembly and linking, always in that order.
395 GCC is capable of preprocessing and compiling several files either into several assembler input files, or into one assembler input file; then each assembler input file produces an object file, and linking combines all the object files (those newly compiled, and those specified as input) into an executable file.
397 For any given input file, the file name suffix determines what kind of compilation is done:
400 .It Em file Ns Sy .c Ns
401 C source code which must be preprocessed.
403 .It Em file Ns Sy .i Ns
404 C source code which should not be preprocessed.
406 .It Em file Ns Sy .ii Ns
407 C++ source code which should not be preprocessed.
409 .It Em file Ns Sy .m Ns
410 Objective-C source code.
411 Note that you must link with the
413 library to make an Objective-C program work.
415 .It Em file Ns Sy .mi Ns
416 Objective-C source code which should not be preprocessed.
418 .It Em file Ns Sy .mm Ns
419 .It Em file Ns Sy .M Ns
420 Objective-C++ source code.
421 Note that you must link with the
423 library to make an Objective-C++ program work.
426 refers to a literal capital M.
428 .It Em file Ns Sy .mii Ns
429 Objective-C++ source code which should not be preprocessed.
431 .It Em file Ns Sy .h Ns
432 C, C++, Objective-C or Objective-C++ header file to be turned into a precompiled header.
434 .It Em file Ns Sy .cc Ns
435 .It Em file Ns Sy .cp Ns
436 .It Em file Ns Sy .cxx Ns
437 .It Em file Ns Sy .cpp Ns
438 .It Em file Ns Sy .CPP Ns
439 .It Em file Ns Sy .c++ Ns
440 .It Em file Ns Sy .C Ns
441 C++ source code which must be preprocessed.
444 the last two letters must both be literally
448 refers to a literal capital C.
450 .It Em file Ns Sy .mm Ns
451 .It Em file Ns Sy .M Ns
452 Objective-C++ source code which must be preprocessed.
454 .It Em file Ns Sy .mii Ns
455 Objective-C++ source code which should not be preprocessed.
457 .It Em file Ns Sy .hh Ns
458 .It Em file Ns Sy .H Ns
459 C++ header file to be turned into a precompiled header.
461 .It Em file Ns Sy .f Ns
462 .It Em file Ns Sy .for Ns
463 .It Em file Ns Sy .FOR Ns
464 Fixed form Fortran source code which should not be preprocessed.
466 .It Em file Ns Sy .F Ns
467 .It Em file Ns Sy .fpp Ns
468 .It Em file Ns Sy .FPP Ns
469 Fixed form Fortran source code which must be preprocessed (with the traditional preprocessor).
471 .It Em file Ns Sy .f90 Ns
472 .It Em file Ns Sy .f95 Ns
473 Free form Fortran source code which should not be preprocessed.
475 .It Em file Ns Sy .F90 Ns
476 .It Em file Ns Sy .F95 Ns
477 Free form Fortran source code which must be preprocessed (with the traditional preprocessor).
479 .It Em file Ns Sy .ads Ns
480 Ada source code file which contains a library unit declaration (a declaration of a package, subprogram, or generic, or a generic instantiation), or a library unit renaming declaration (a package, generic, or subprogram renaming declaration).
481 Such files are also called
484 .It Em file Ns Sy .adb Ns
485 Ada source code file containing a library unit body (a subprogram or package body).
486 Such files are also called
489 .It Em file Ns Sy .s Ns
492 .It Em file Ns Sy .S Ns
493 Assembler code which must be preprocessed.
496 An object file to be fed straight into linking.
497 Any file name with no recognized suffix is treated this way.
500 You can specify the input language explicitly with the
506 Specify explicitly the
508 for the following input files (rather than letting the compiler choose a default based on the file name suffix).
509 This option applies to all following input files until the next
516 .Bd -literal -offset indent
517 c c-header c-cpp-output
518 c++ c++-header c++-cpp-output
519 objective-c objective-c-header objective-c-cpp-output
520 objective-c++ objective-c++-header objective-c++-cpp-output
521 assembler assembler-with-cpp
528 Turn off any specification of a language, so that subsequent files are handled according to their file name suffixes (as they are if
530 has not been used at all).
532 .It Fl pass-exit-codes
535 program will exit with the code of 1 if any phase of the compiler returns a non-success return code.
537 .Fl pass-exit-codes ,
540 program will instead return with numerically highest error produced by any phase that returned an error indication.
543 If you only want some of the stages of compilation, you can use
545 (or filename suffixes) to tell
547 where to start, and one of the options
555 Note that some combinations (for example,
556 .Fl x Ar cpp-output Fl E )
559 to do nothing at all.
563 Compile or assemble the source files, but do not link.
564 The linking stage simply is not done.
565 The ultimate output is in the form of an object file for each source file.
567 By default, the object file name for a source file is made by replacing the suffix
574 Unrecognized input files, not requiring compilation or assembly, are ignored.
577 Stop after the stage of compilation proper; do not assemble.
578 The output is in the form of an assembler code file for each non-assembler input file specified.
580 By default, the assembler file name for a source file is made by replacing the suffix
586 Input files that don't require compilation are ignored.
589 Stop after the preprocessing stage; do not run the compiler proper.
590 The output is in the form of preprocessed source code, which is sent to the standard output.
592 Input files which don't require preprocessing are ignored.
597 This applies regardless to whatever sort of output is being produced, whether it be an executable file, an object file, an assembler file or preprocessed C code.
601 is not specified, the default is to put an executable file in
607 its assembler file in
609 a precompiled header file in
610 .Pa source.suffix.gch ,
611 and all preprocessed C source on standard output.
614 Print (on standard error output) the commands executed to run the stages of compilation.
615 Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.
620 except the commands are not executed and all command arguments are quoted.
621 This is useful for shell scripts to capture the driver-generated command lines.
624 Use pipes rather than temporary files for communication between the various stages of compilation.
625 This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble.
628 If you are compiling multiple source files, this option tells the driver to pass all the source files to the compiler at once (for those languages for which the compiler can handle this).
629 This will allow intermodule analysis (IMA) to be performed by the compiler.
630 Currently the only language for which this is supported is C.
631 If you pass source files for multiple languages to the driver, using this option, the driver will invoke the compiler(s) that support IMA once each, passing each compiler all the source files appropriate for it.
632 For those languages that do not support IMA this option will be ignored, and the compiler will be invoked once for each source file in that language.
633 If you use this option in conjunction with
635 the compiler will generate multiple pre-processed files (one for each source file), but only one (combined)
642 Print (on the standard output) a description of the command line options understood by
646 option is also specified then
648 will also be passed on to the various processes invoked by
650 so that they can display the command line options they accept.
653 option is also specified then command line options which have no documentation associated with them will also be displayed.
656 Print (on the standard output) a description of target specific command line options for each tool.
659 Display the version number and copyrights of the invoked GCC.
662 .Ss Compiling C++ Programs
663 C++ source files conventionally use one of the suffixes
672 C++ header files often use
676 and preprocessed C++ files use the suffix
678 GCC recognizes files with these names and compiles them as C++ programs even if you call the compiler the same way as for compiling C programs (usually with the name
681 However, C++ programs often require class libraries as well as a compiler that understands the C++ language---and under some circumstances, you might want to compile programs or header files from standard input, or otherwise without a suffix that flags them as C++ programs.
682 You might also like to precompile a C header file with a
684 extension to be used in C++ compilations.
686 is a program that calls GCC with the default language set to C++, and automatically specifies linking against the C++ library.
689 is also installed with the name
692 When you compile C++ programs, you may specify many of the same command-line options that you use for compiling programs in any language; or command-line options meaningful for C and related languages; or options that are meaningful only for C++ programs.
693 .Ss Options Controlling C Dialect
694 The following options control the dialect of C (or languages derived from C, such as C++, Objective-C and Objective-C++) that the compiler accepts:
698 In C mode, support all ISO C90 programs.
699 In C++ mode, remove GNU extensions that conflict with ISO C++.
701 This turns off certain features of GCC that are incompatible with ISO C90 (when compiling C code), or of standard C++ (when compiling C++ code), such as the
705 keywords, and predefined macros such as
709 that identify the type of system you are using.
710 It also enables the undesirable and rarely used ISO trigraph feature.
711 For the C compiler, it disables recognition of C++ style
713 comments as well as the
717 The alternate keywords
723 continue to work despite
725 You would not want to use them in an ISO C program, of course, but it is useful to put them in header files that might be included in compilations done with
727 Alternate predefined macros such as
731 are also available, with or without
736 option does not cause non-ISO programs to be rejected gratuitously.
739 is required in addition to
744 is predefined when the
747 Some header files may notice this macro and refrain from declaring certain functions or defining certain macros that the ISO standard doesn't call for; this is to avoid interfering with any programs that might use these names for other things.
749 Functions which would normally be built in but do not have semantics defined by ISO C (such as
753 are not built-in functions with
758 Determine the language standard.
759 This option is currently only supported when compiling C or C++.
760 A value for this option must be provided; possible values are
764 .It Sy iso9899:1990 Ns
768 .It Sy iso9899:199409 Ns
769 ISO C90 as modified in amendment 1.
773 .It Sy iso9899:1999 Ns
774 .It Sy iso9899:199x Ns
776 Note that this standard is not yet fully supported; see
777 .Lk http://gcc.gnu.org/gcc-4.1/c99status.html
778 for more information.
786 Default, ISO C90 plus GNU extensions (including some C99 features).
790 ISO C99 plus GNU extensions.
791 When ISO C99 is fully implemented in GCC, this will become the default.
797 The 1998 ISO C++ standard plus amendments.
803 This is the default for C++ code.
806 Even when this option is not specified, you can still use some of the features of newer standards in so far as they do not conflict with previous C standards.
807 For example, you may use
815 options specifying some version of ISO C have the same effects as
817 except that features that were not in ISO C90 but are in the specified version (for example,
821 keyword in ISO C99) are not disabled.
826 tells GCC to use the traditional GNU semantics for
828 functions when in C99 mode.
829 Using this option is roughly equivalent to adding the
831 function attribute to all inline functions.
833 This option is accepted by GCC versions 4.1.3 and up.
834 In GCC versions prior to 4.3, C99 inline semantics are not supported, and thus this option is effectively assumed to be present regardless of whether or not it is specified; the only effect of specifying it explicitly is to disable warnings about using inline functions in C99 mode.
837 is not supported in versions of GCC before 4.3.
838 It will be supported only in C99 or gnu99 mode, not in C89 or gnu89 mode.
840 The preprocesor macros
841 .Va __GNUC_GNU_INLINE__
843 .Va __GNUC_STDC_INLINE__
844 may be used to check which semantics are in effect for
848 .It Fl aux-info Ar filename
849 Output to the given filename prototyped declarations for all functions declared and/or defined in a translation unit, including those in header files.
850 This option is silently ignored in any language other than C.
852 Besides declarations, the file indicates, in comments, the origin of each declaration (source file and line), whether the declaration was implicit, prototyped or unprototyped
857 for old, respectively, in the first character after the line number and the colon), and whether it came from a declaration or a definition
861 respectively, in the following character).
862 In the case of function definitions, a K&R-style list of arguments followed by their declarations is also provided, inside comments, after the declaration.
870 as a keyword, so that code can use these words as identifiers.
871 You can use the keywords
881 In C++, this switch only affects the
887 are standard keywords.
888 You may want to use the
890 flag instead, which has the same effect.
895 this switch only affects the
901 is a standard keyword in ISO C99.
904 .It Fl fno-builtin- Ns Ar function
905 Don't recognize built-in functions that do not begin with
909 GCC normally generates special code to handle certain built-in functions more efficiently; for instance, calls to
911 may become single instructions that adjust the stack directly, and calls to
913 may become inline copy loops.
914 The resulting code is often both smaller and faster, but since the function calls no longer appear as such, you cannot set a breakpoint on those calls, nor can you change the behavior of the functions by linking with a different library.
915 In addition, when a function is recognized as a built-in function, GCC may use information about that function to warn about problems with calls to that function, or to generate more efficient code, even if the resulting code still contains calls to that function.
916 For example, warnings are given with
924 is known not to modify global memory.
927 .Fl fno-builtin- Ns Ar function
928 option only the built-in function
934 If a function is named this is not built-in in this version of GCC, this option is ignored.
935 There is no corresponding
936 .Fl fbuiltin- Ns Ar function
937 option; if you wish to enable built-in functions selectively when using
941 you may define macros such as:
943 .Bd -literal -offset indent
944 #define abs(n) __builtin_abs ((n))
945 #define strcpy(d, s) __builtin_strcpy ((d), (s))
948 Assert that compilation takes place in a hosted environment.
951 A hosted environment is one in which the entire standard library is available, and in which
955 Examples are nearly everything except a kernel.
956 This is equivalent to
957 .Fl fno-freestanding .
960 Assert that compilation takes place in a freestanding environment.
963 A freestanding environment is one in which the standard library may not exist, and program startup may not necessarily be at
965 The most obvious example is an OS kernel.
966 This is equivalent to
969 .It Fl fms-extensions
970 Accept some non-standard constructs used in Microsoft header files.
972 Some cases of unnamed fields in structures and unions are only accepted with this option.
975 Support ISO C trigraphs.
980 options for strict ISO C conformance) implies
983 .It Fl no-integrated-cpp
984 Performs a compilation in two passes: preprocessing and compiling.
985 This option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
988 The user supplied compilation step can then add in an additional preprocessing step after normal preprocessing but before compiling.
989 The default is to use the integrated cpp (internal cpp)
991 The semantics of this option will change if "cc1", "cc1plus", and "cc1obj" are merged.
994 .It Fl traditional-cpp
995 Formerly, these options caused GCC to attempt to emulate a pre-standard C compiler.
996 They are now only supported with the
999 The preprocessor continues to support a pre-standard mode.
1000 See the GNU CPP manual for details.
1002 .It Fl fcond-mismatch
1003 Allow conditional expressions with mismatched types in the second and third arguments.
1004 The value of such an expression is void.
1005 This option is not supported for C++.
1007 .It Fl funsigned-char
1013 Each kind of machine has a default for what
1022 Ideally, a portable program should always use
1026 when it depends on the signedness of an object.
1027 But many programs have been written to use plain
1029 and expect it to be signed, or expect it to be unsigned, depending on the machines they were written for.
1030 This option, and its inverse, let you make such a program work with the opposite default.
1034 is always a distinct type from each of
1038 even though its behavior is always just like one of those two.
1046 Note that this is equivalent to
1047 .Fl fno-unsigned-char ,
1048 which is the negative form of
1049 .Fl funsigned-char .
1050 Likewise, the option
1053 .Fl funsigned-char .
1055 .It Fl fsigned-bitfields
1056 .It Fl funsigned-bitfields
1057 .It Fl fno-signed-bitfields
1058 .It Fl fno-unsigned-bitfields
1059 These options control whether a bit-field is signed or unsigned, when the declaration does not use either
1063 By default, such a bit-field is signed, because this is consistent: the basic integer types such as
1068 .Ss Options Controlling C++ Dialect
1069 This section describes the command-line options that are only meaningful for C++ programs; but you can also use most of the GNU compiler options regardless of what language your program is in.
1070 For example, you might compile a file
1074 .Bd -literal -offset indent
1075 g++ -g -frepo -O -c firstClass.C
1077 In this example, only
1079 is an option meant only for C++ programs; you can use the other options with any language supported by GCC.
1081 Here is a list of options that are
1083 for compiling C++ programs:
1086 .It Fl fabi-version= Ns Ar n
1090 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.
1091 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
1092 Version 0 will always be the version that conforms most closely to the C++ ABI specification.
1093 Therefore, the ABI obtained using version 0 will change as ABI bugs are fixed.
1095 The default is version 2.
1097 .It Fl fno-access-control
1098 Turn off all access checking.
1099 This switch is mainly useful for working around bugs in the access control code.
1102 Check that the pointer returned by
1104 is non-null before attempting to modify the storage allocated.
1105 This check is normally unnecessary because the C++ standard specifies that
1111 in which case the compiler will always check the return value even without this option.
1112 In all other cases, when
1114 has a non-empty exception specification, memory exhaustion is signalled by throwing
1115 .Va std::bad_alloc .
1119 .It Fl fconserve-space
1120 Put uninitialized or runtime-initialized global variables into the common segment, as C does.
1121 This saves space in the executable at the cost of not diagnosing duplicate definitions.
1122 If you compile with this flag and your program mysteriously crashes after
1124 has completed, you may have an object that is being destroyed twice because two definitions were merged.
1126 This option is no longer useful on most targets, now that support has been added for putting variables into BSS without making them common.
1128 .It Fl ffriend-injection
1129 Inject friend functions into the enclosing namespace, so that they are visible outside the scope of the class in which they are declared.
1130 Friend functions were documented to work this way in the old Annotated C++ Reference Manual, and versions of G++ before 4.1 always worked that way.
1131 However, in ISO C++ a friend function which is not declared in an enclosing scope can only be found using argument dependent lookup.
1132 This option causes friends to be injected as they were in earlier releases.
1134 This option is for compatibility, and may be removed in a future release of G++.
1136 .It Fl fno-const-strings
1137 Give string constants type
1141 By default, G++ uses type
1143 as required by the standard.
1145 .Fl fno-const-strings ,
1146 you cannot actually modify the value of a string constant.
1148 This option might be removed in a future release of G++.
1149 For maximum portability, you should structure your code so that it works with string constants that have type
1152 .It Fl fno-elide-constructors
1153 The C++ standard allows an implementation to omit creating a temporary which is only used to initialize another object of the same type.
1154 Specifying this option disables that optimization, and forces G++ to call the copy constructor in all cases.
1156 .It Fl fno-enforce-eh-specs
1157 Don't generate code to check for violation of exception specifications at runtime.
1158 This option violates the C++ standard, but may be useful for reducing code size in production builds, much like defining
1160 This does not give user code permission to throw exceptions in violation of the exception specifications; the compiler will still optimize based on the specifications, so throwing an unexpected exception will result in undefined behavior.
1163 .It Fl fno-for-scope
1166 is specified, the scope of variables declared in a
1167 .Em for-init-statement
1170 loop itself, as specified by the C++ standard.
1173 is specified, the scope of variables declared in a
1174 .Em for-init-statement
1175 extends to the end of the enclosing scope, as was the case in old versions of G++, and other (traditional) implementations of C++.
1177 The default if neither flag is given to follow the standard, but to allow and give a warning for old-style code that would otherwise be invalid, or have different behavior.
1179 .It Fl fno-gnu-keywords
1182 as a keyword, so that code can use this word as an identifier.
1183 You can use the keyword
1188 .Fl fno-gnu-keywords .
1190 .It Fl fno-implicit-templates
1191 Never emit code for non-inline templates which are instantiated implicitly (i.e. by use); only emit code for explicit instantiations.
1193 .It Fl fno-implicit-inline-templates
1194 Don't emit code for implicit instantiations of inline templates, either.
1195 The default is to handle inlines differently so that compiles with and without optimization will need the same set of explicit instantiations.
1197 .It Fl fno-implement-inlines
1198 To save space, do not emit out-of-line copies of inline functions controlled by
1199 .Sy #pragma implementation .
1200 This will cause linker errors if these functions are not inlined everywhere they are called.
1202 .It Fl fms-extensions
1203 Disable pedantic warnings about constructs used in MFC, such as implicit int and getting a pointer to member function via non-standard syntax.
1205 .It Fl fno-nonansi-builtins
1206 Disable built-in declarations of functions that are not mandated by ANSI/ISO C.
1214 and other related functions.
1216 .It Fl fno-operator-names
1217 Do not treat the operator name keywords
1226 as synonyms as keywords.
1228 .It Fl fno-optional-diags
1229 Disable diagnostics that the standard says a compiler does not need to issue.
1230 Currently, the only such diagnostic issued by G++ is the one for a name having multiple meanings within a class.
1233 Downgrade some diagnostics about nonconformant code from errors to warnings.
1236 will allow some nonconforming code to compile.
1239 Enable automatic template instantiation at link time.
1240 This option also implies
1241 .Fl fno-implicit-templates .
1244 Disable generation of information about every class with virtual functions for use by the C++ runtime type identification features
1248 If you don't use those parts of the language, you can save some space by using this flag.
1249 Note that exception handling uses the same information, but it will generate it as needed.
1252 Emit statistics about front-end processing at the end of the compilation.
1253 This information is generally only useful to the G++ development team.
1255 .It Fl ftemplate-depth- Ns Ar n
1256 Set the maximum instantiation depth for template classes to
1258 A limit on the template instantiation depth is needed to detect endless recursions during template class instantiation.
1259 ANSI/ISO C++ conforming programs must not rely on a maximum depth greater than 17.
1261 .It Fl fno-threadsafe-statics
1262 Do not emit the extra code to use the routines specified in the C++ ABI for thread-safe initialization of local statics.
1263 You can use this option to reduce code size slightly in code that doesn't need to be thread-safe.
1265 .It Fl fuse-cxa-atexit
1266 Register destructors for objects with static storage duration with the
1268 function rather than the
1271 This option is required for fully standards-compliant handling of static destructors, but will only work if your C library supports
1274 .It Fl fvisibility-inlines-hidden
1275 Causes all inlined methods to be marked with
1276 .Va __attribute__ ((visibility ("hidden")))
1277 so that they do not appear in the export table of a DSO and do not require a PLT indirection when used within the DSO.
1278 Enabling this option can have a dramatic effect on load and link times of a DSO as it massively reduces the size of the dynamic export table when the library makes heavy use of templates.
1279 While it can cause bloating through duplication of code within each DSO where it is used, often the wastage is less than the considerable space occupied by a long symbol name in the export table which is typical when using templates and namespaces.
1280 For even more savings, combine with the
1281 .Fl fvisibility=hidden
1285 Do not use weak symbol support, even if it is provided by the linker.
1286 By default, G++ will use weak symbols if they are available.
1287 This option exists only for testing, and should not be used by end-users; it will result in inferior code and has no benefits.
1288 This option may be removed in a future release of G++.
1291 Do not search for header files in the standard directories specific to C++, but do still search the other standard directories.
1292 (This option is used when building the C++ library.)
1295 In addition, these optimization, warning, and code generation options have meanings only for C++ programs:
1298 .It Fl fno-default-inline
1301 for functions defined inside a class scope.
1302 Note that these functions will have linkage like inline functions; they just won't be inlined by default.
1304 .It Fl Wabi (C++ only)
1305 Warn when G++ generates code that is probably not compatible with the vendor-neutral C++ ABI.
1306 Although an effort has been made to warn about all such cases, there are probably some cases that are not warned about, even though G++ is generating incompatible code.
1307 There may also be cases where warnings are emitted even though the code that is generated will be compatible.
1309 You should rewrite your code to avoid these warnings if you are concerned about the fact that code generated by G++ may not be binary compatible with code generated by other compilers.
1311 The known incompatibilities at this point include:
1315 Incorrect handling of tail-padding for bit-fields.
1316 G++ may attempt to pack data into the same byte as a base class.
1319 .Bd -literal -offset indent
1320 struct A { virtual void f(); int f1 : 1; };
1321 struct B : public A { int f2 : 1; };
1323 In this case, G++ will place
1325 into the same byte as
1327 other compilers will not.
1328 You can avoid this problem by explicitly padding
1330 so that its size is a multiple of the byte size on your platform; that will cause G++ and other compilers to layout
1335 Incorrect handling of tail-padding for virtual bases.
1336 G++ does not use tail padding when laying out virtual bases.
1339 .Bd -literal -offset indent
1340 struct A { virtual void f(); char c1; };
1341 struct B { B(); char c2; };
1342 struct C : public A, public virtual B {};
1344 In this case, G++ will not place
1346 into the tail-padding for
1348 other compilers will.
1349 You can avoid this problem by explicitly padding
1351 so that its size is a multiple of its alignment (ignoring virtual base classes); that will cause G++ and other compilers to layout
1356 Incorrect handling of bit-fields with declared widths greater than that of their underlying types, when the bit-fields appear in a union.
1359 .Bd -literal -offset indent
1360 union U { int i : 4096; };
1364 does not have 4096 bits, G++ will make the union too small by the number of bits in an
1368 Empty classes can be placed at incorrect offsets.
1371 .Bd -literal -offset indent
1379 struct C : public B, public A {};
1385 at a nonzero offset; it should be placed at offset zero.
1386 G++ mistakenly believes that the
1390 is already at offset zero.
1393 Names of template functions whose types involve
1395 or template template parameters can be mangled incorrectly.
1397 .Bd -literal -offset indent
1398 template \*[Lt]typename Q\*[Gt]
1399 void f(typename Q::X) {}
1401 template \*[Lt]template \*[Lt]typename\*[Gt] class Q\*[Gt]
1402 void f(typename Q\*[Lt]int\*[Gt]::X) {}
1404 Instantiations of these templates may be mangled incorrectly.
1407 .It Fl Wctor-dtor-privacy (C++ only)
1408 Warn when a class seems unusable because all the constructors or destructors in that class are private, and it has neither friends nor public static member functions.
1410 .It Fl Wnon-virtual-dtor (C++ only)
1411 Warn when a class appears to be polymorphic, thereby requiring a virtual destructor, yet it declares a non-virtual one.
1412 This warning is enabled by
1415 .It Fl Wreorder (C++ only)
1416 Warn when the order of member initializers given in the code does not match the order in which they must be executed.
1419 .Bd -literal -offset indent
1423 A(): j (0), i (1) { }
1426 The compiler will rearrange the member initializers for
1430 to match the declaration order of the members, emitting a warning to that effect.
1431 This warning is enabled by
1437 options are not affected by
1441 .It Fl Weffc++ (C++ only)
1442 Warn about violations of the following style guidelines from Scott Meyers'
1448 Item 11: Define a copy constructor and an assignment operator for classes with dynamically allocated memory.
1451 Item 12: Prefer initialization to assignment in constructors.
1454 Item 14: Make destructors virtual in base classes.
1459 return a reference to
1463 Item 23: Don't try to return a reference when you must return an object.
1466 Also warn about violations of the following style guidelines from Scott Meyers'
1467 .Em More Effective C++
1472 Item 6: Distinguish between prefix and postfix forms of increment and decrement operators.
1475 Item 7: Never overload
1482 When selecting this option, be aware that the standard library headers do not obey all of these guidelines; use
1484 to filter out those warnings.
1486 .It Fl Wno-deprecated (C++ only)
1487 Do not warn about usage of deprecated features.
1489 .It Fl Wstrict-null-sentinel (C++ only)
1490 Warn also about the use of an uncasted
1493 When compiling only with GCC this is a valid sentinel, as
1497 Although it is a null pointer constant not a null pointer, it is guaranteed to of the same size as a pointer.
1498 But this use is not portable across different compilers.
1500 .It Fl Wno-non-template-friend (C++ only)
1501 Disable warnings when non-templatized friend functions are declared within a template.
1502 Since the advent of explicit template specification support in G++, if the name of the friend is an unqualified-id (i.e.,
1503 .Sy friend foo(int) ) ,
1504 the C++ language specification demands that the friend declare or define an ordinary, nontemplate function.
1506 Before G++ implemented explicit specification, unqualified-ids could be interpreted as a particular specialization of a templatized function.
1507 Because this non-conforming behavior is no longer the default behavior for G++,
1508 .Fl Wnon-template-friend
1509 allows the compiler to check existing code for potential trouble spots and is on by default.
1510 This new compiler behavior can be turned off with
1511 .Fl Wno-non-template-friend
1512 which keeps the conformant compiler code but disables the helpful warning.
1514 .It Fl Wold-style-cast (C++ only)
1515 Warn if an old-style (C-style) cast to a non-void type is used within a C++ program.
1517 .Sy ( dynamic_cast ,
1519 .Sy reinterpret_cast ,
1522 are less vulnerable to unintended effects and much easier to search for.
1524 .It Fl Woverloaded-virtual (C++ only)
1525 Warn when a function declaration hides virtual functions from a base class.
1528 .Bd -literal -offset indent
1533 struct B: public A {
1545 .Bd -literal -offset indent
1549 will fail to compile.
1551 .It Fl Wno-pmf-conversions (C++ only)
1552 Disable the diagnostic for converting a bound pointer to member function to a plain pointer.
1554 .It Fl Wsign-promo (C++ only)
1555 Warn when overload resolution chooses a promotion from unsigned or enumerated type to a signed type, over a conversion to an unsigned type of the same size.
1556 Previous versions of G++ would try to preserve unsignedness, but the standard mandates the current behavior.
1558 .Bd -literal -offset indent
1561 A& operator = (int);
1570 In this example, G++ will synthesize a default
1571 .Sy A& operator = (const A&); ,
1572 while cfront will use the user-defined
1576 .Ss Options Controlling Objective-C and Objective-C++ Dialects
1577 (NOTE: This manual does not describe the Objective-C and Objective-C++ languages themselves.
1580 This section describes the command-line options that are only meaningful for Objective-C and Objective-C++ programs, but you can also use most of the language-independent GNU compiler options.
1581 For example, you might compile a file
1585 .Bd -literal -offset indent
1586 gcc -g -fgnu-runtime -O -c some_class.m
1590 is an option meant only for Objective-C and Objective-C++ programs; you can use the other options with any language supported by GCC.
1592 Note that since Objective-C is an extension of the C language, Objective-C compilations may also use options specific to the C front-end (e.g.,
1593 .Fl Wtraditional ) .
1594 Similarly, Objective-C++ compilations may use C++-specific options (e.g.,
1597 Here is a list of options that are
1599 for compiling Objective-C and Objective-C++ programs:
1602 .It Fl fconstant-string-class= Ns Ar class-name
1605 as the name of the class to instantiate for each literal string specified with the syntax
1607 The default class name is
1608 .Va NXConstantString
1609 if the GNU runtime is being used, and
1610 .Va NSConstantString
1611 if the NeXT runtime is being used (see below).
1613 .Fl fconstant-cfstrings
1614 option, if also present, will override the
1615 .Fl fconstant-string-class
1618 literals to be laid out as constant CoreFoundation strings.
1621 Generate object code compatible with the standard GNU Objective-C runtime.
1622 This is the default for most types of systems.
1624 .It Fl fnext-runtime
1625 Generate output compatible with the NeXT runtime.
1626 This is the default for NeXT-based systems, including Darwin and Mac OS X.
1628 .Va __NEXT_RUNTIME__
1629 is predefined if (and only if) this option is used.
1631 .It Fl fno-nil-receivers
1632 Assume that all Objective-C message dispatches (e.g.,
1633 .Va [receiver message:arg] )
1634 in this translation unit ensure that the receiver is not
1636 This allows for more efficient entry points in the runtime to be used.
1637 Currently, this option is only available in conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1639 .It Fl fobjc-call-cxx-cdtors
1640 For each Objective-C class, check if any of its instance variables is a C++ object with a non-trivial default constructor.
1641 If so, synthesize a special
1642 .Va - (id) .cxx_construct
1643 instance method that will run non-trivial default constructors on any such instance variables, in order, and then return
1645 Similarly, check if any instance variable is a C++ object with a non-trivial destructor, and if so, synthesize a special
1646 .Va - (void) .cxx_destruct
1647 method that will run all such default destructors, in reverse order.
1650 .Va - (id) .cxx_construct
1652 .Va - (void) .cxx_destruct
1653 methods thusly generated will only operate on instance variables declared in the current Objective-C class, and not those inherited from superclasses.
1654 It is the responsibility of the Objective-C runtime to invoke all such methods in an object's inheritance hierarchy.
1656 .Va - (id) .cxx_construct
1657 methods will be invoked by the runtime immediately after a new object instance is allocated; the
1658 .Va - (void) .cxx_destruct
1659 methods will be invoked immediately before the runtime deallocates an object instance.
1661 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has support for invoking the
1662 .Va - (id) .cxx_construct
1664 .Va - (void) .cxx_destruct
1667 .It Fl fobjc-direct-dispatch
1668 Allow fast jumps to the message dispatcher.
1669 On Darwin this is accomplished via the comm page.
1671 .It Fl fobjc-exceptions
1672 Enable syntactic support for structured exception handling in Objective-C, similar to what is offered by C++ and Java.
1673 Currently, this option is only available in conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1675 .Bd -literal -offset indent
1681 @catch (AnObjCClass *exc) {
1688 @catch (AnotherClass *exc) {
1691 @catch (id allOthers) {
1702 statement may appear anywhere in an Objective-C or Objective-C++ program; when used inside of a
1706 may appear without an argument (as shown above), in which case the object caught by the
1710 Note that only (pointers to) Objective-C objects may be thrown and caught using this scheme.
1711 When an object is thrown, it will be caught by the nearest
1713 clause capable of handling objects of that type, analogously to how
1715 blocks work in C++ and Java.
1718 clause (as shown above) may also be provided to catch any and all Objective-C exceptions not caught by previous
1724 clause, if present, will be executed upon exit from the immediately preceding
1727 This will happen regardless of whether any exceptions are thrown, caught or rethrown inside the
1729 section, analogously to the behavior of the
1733 There are several caveats to using the new exception mechanism:
1737 Although currently designed to be binary compatible with
1739 -style idioms provided by the
1741 class, the new exceptions can only be used on Mac OS X 10.3 (Panther) and later systems, due to additional functionality needed in the (NeXT) Objective-C runtime.
1744 As mentioned above, the new exceptions do not support handling types other than Objective-C objects.
1745 Furthermore, when used from Objective-C++, the Objective-C exception model does not interoperate with C++ exceptions at this time.
1746 This means you cannot
1748 an exception from Objective-C and
1750 it in C++, or vice versa (i.e.,
1751 .Va throw ... @catch ) .
1755 .Fl fobjc-exceptions
1756 switch also enables the use of synchronization blocks for thread-safe execution:
1758 .Bd -literal -offset indent
1759 @synchronized (ObjCClass *guard) {
1765 block, a thread of execution shall first check whether a lock has been placed on the corresponding
1767 object by another thread.
1768 If it has, the current thread shall wait until the other thread relinquishes its lock.
1771 becomes available, the current thread will place its own lock on it, execute the code contained in the
1773 block, and finally relinquish the lock (thereby making
1775 available to other threads).
1777 Unlike Java, Objective-C does not allow for entire methods to be marked
1779 Note that throwing exceptions out of
1781 blocks is allowed, and will cause the guarding object to be unlocked properly.
1784 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
1786 .It Fl freplace-objc-classes
1787 Emit a special marker instructing
1789 not to statically link in the resulting object file, and allow
1791 to load it in at run time instead.
1792 This is used in conjunction with the Fix-and-Continue debugging mode, where the object file in question may be recompiled and dynamically reloaded in the course of program execution, without the need to restart the program itself.
1793 Currently, Fix-and-Continue functionality is only available in conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1796 When compiling for the NeXT runtime, the compiler ordinarily replaces calls to
1797 .Va objc_getClass("...")
1798 (when the name of the class is known at compile time) with static class references that get initialized at load time, which improves run-time performance.
1801 flag suppresses this behavior and causes calls to
1802 .Va objc_getClass("...")
1804 This is useful in Zero-Link debugging mode, since it allows for individual class implementations to be modified during program execution.
1807 Dump interface declarations for all classes seen in the source file to a file named
1808 .Pa sourcename.decl .
1810 .It Fl Wassign-intercept
1811 Warn whenever an Objective-C assignment is being intercepted by the garbage collector.
1814 If a class is declared to implement a protocol, a warning is issued for every method in the protocol that is not implemented by the class.
1815 The default behavior is to issue a warning for every method not explicitly implemented in the class, even if a method implementation is inherited from the superclass.
1818 option, then methods inherited from the superclass are considered to be implemented, and no warning is issued for them.
1821 Warn if multiple methods of different types for the same selector are found during compilation.
1822 The check is performed on the list of methods in the final stage of compilation.
1823 Additionally, a check is performed for each selector appearing in a
1825 expression, and a corresponding method for that selector has been found during compilation.
1826 Because these checks scan the method table only at the end of compilation, these warnings are not produced if the final stage of compilation is not reached, for example because an error is found during compilation, or because the
1828 option is being used.
1830 .It Fl Wstrict-selector-match
1831 Warn if multiple methods with differing argument and/or return types are found for a given selector when attempting to send a message using this selector to a receiver of type
1835 When this flag is off (which is the default behavior), the compiler will omit such warnings if any differences found are confined to types which share the same size and alignment.
1837 .It Fl Wundeclared-selector
1840 expression referring to an undeclared selector is found.
1841 A selector is considered undeclared if no method with that name has been declared before the
1843 expression, either explicitly in an
1847 declaration, or implicitly in an
1850 This option always performs its checks as soon as a
1852 expression is found, while
1854 only performs its checks in the final stage of compilation.
1855 This also enforces the coding style convention that methods and selectors must be declared before being used.
1857 .It Fl print-objc-runtime-info
1858 Generate C header describing the largest structure that is passed by value, if any.
1861 .Ss Options to Control Diagnostic Messages Formatting
1862 Traditionally, diagnostic messages have been formatted irrespective of the output device's aspect (e.g. its width, ...).
1863 The options described below can be used to control the diagnostic messages formatting algorithm, e.g. how many characters per line, how often source location information should be reported.
1864 Right now, only the C++ front end can honor these options.
1865 However it is expected, in the near future, that the remaining front ends would be able to digest them correctly.
1868 .It Fl fmessage-length= Ns Ar n
1869 Try to format error messages so that they fit on lines of about
1872 The default is 72 characters for
1874 and 0 for the rest of the front ends supported by GCC.
1877 is zero, then no line-wrapping will be done; each error message will appear on a single line.
1879 .It Fl fdiagnostics-show-location=once
1880 Only meaningful in line-wrapping mode.
1881 Instructs the diagnostic messages reporter to emit
1883 source location information; that is, in case the message is too long to fit on a single physical line and has to be wrapped, the source location won't be emitted (as prefix) again, over and over, in subsequent continuation lines.
1884 This is the default behavior.
1886 .It Fl fdiagnostics-show-location=every-line
1887 Only meaningful in line-wrapping mode.
1888 Instructs the diagnostic messages reporter to emit the same source location information (as prefix) for physical lines that result from the process of breaking a message which is too long to fit on a single line.
1890 .It Fl fdiagnostics-show-options
1891 This option instructs the diagnostic machinery to add text to each diagnostic emitted, which indicates which command line option directly controls that diagnostic, when such an option is known to the diagnostic machinery.
1894 .Ss Options to Request or Suppress Warnings
1895 Warnings are diagnostic messages that report constructions which are not inherently erroneous but which are risky or suggest there may have been an error.
1897 You can request many specific warnings with options beginning
1901 to request warnings on implicit declarations.
1902 Each of these specific warning options also has a negative form beginning
1904 to turn off warnings; for example,
1906 This manual lists only one of the two forms, whichever is not the default.
1908 The following options control the amount and kinds of warnings produced by GCC; for further, language-specific options also refer to
1909 .Sy C++ Dialect Options
1911 .Sy Objective-C and Objective-C++ Dialect Options .
1915 Check the code for syntax errors, but don't do anything beyond that.
1918 Issue all the warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden extensions, and some other programs that do not follow ISO C and ISO C++.
1919 For ISO C, follows the version of the ISO C standard specified by any
1923 Valid ISO C and ISO C++ programs should compile properly with or without this option (though a rare few will require
1927 option specifying the required version of ISO C).
1928 However, without this option, certain GNU extensions and traditional C and C++ features are supported as well.
1929 With this option, they are rejected.
1932 does not cause warning messages for use of the alternate keywords whose names begin and end with
1934 Pedantic warnings are also disabled in the expression that follows
1936 However, only system header files should use these escape routes; application programs should avoid them.
1938 Some users try to use
1940 to check programs for strict ISO C conformance.
1941 They soon find that it does not do quite what they want: it finds some non-ISO practices, but not all---only those for which ISO C
1943 a diagnostic, and some others for which diagnostics have been added.
1945 A feature to report any failure to conform to ISO C might be useful in some instances, but would require considerable additional work and would be quite different from
1947 We don't have plans to support such a feature in the near future.
1949 Where the standard specified with
1951 represents a GNU extended dialect of C, such as
1955 there is a corresponding
1957 the version of ISO C on which the GNU extended dialect is based.
1960 are given where they are required by the base standard.
1961 (It would not make sense for such warnings to be given only for features not in the specified GNU C dialect, since by definition the GNU dialects of C include all features the compiler supports with the given option, and there would be nothing to warn about.)
1963 .It Fl pedantic-errors
1966 except that errors are produced rather than warnings.
1969 Inhibit all warning messages.
1972 Inhibit warning messages about the use of
1975 .It Fl Wchar-subscripts
1976 Warn if an array subscript has type
1978 This is a common cause of error, as programmers often forget that this type is signed on some machines.
1979 This warning is enabled by
1983 Warn whenever a comment-start sequence
1987 comment, or whenever a Backslash-Newline appears in a
1990 This warning is enabled by
1993 .It Fl Wfatal-errors
1994 This option causes the compiler to abort compilation on the first error occurred rather than trying to keep going and printing further error messages.
2001 etc., to make sure that the arguments supplied have types appropriate to the format string specified, and that the conversions specified in the format string make sense.
2002 This includes standard functions, and others specified by format attributes, in the
2008 (an X/Open extension, not in the C standard) families (or other target-specific families).
2009 Which functions are checked without format attributes having been specified depends on the standard version selected, and such checks of functions without the attribute specified are disabled by
2014 The formats are checked against the format features supported by GNU libc version 2.2.
2015 These include all ISO C90 and C99 features, as well as features from the Single Unix Specification and some BSD and GNU extensions.
2016 Other library implementations may not support all these features; GCC does not support warning about features that go beyond a particular library's limitations.
2021 warnings will be given about format features not in the selected standard version (but not for
2023 formats, since those are not in any version of the C standard).
2027 also checks for null format arguments for several functions,
2035 For more control over some aspects of format checking, the options
2037 .Fl Wno-format-extra-args ,
2038 .Fl Wno-format-zero-length ,
2039 .Fl Wformat-nonliteral ,
2040 .Fl Wformat-security ,
2043 are available, but are not included in
2049 is specified, also warn about
2051 formats which may yield only a two-digit year.
2053 .It Fl Wno-format-extra-args
2056 is specified, do not warn about excess arguments to a
2061 The C standard specifies that such arguments are ignored.
2063 Where the unused arguments lie between used arguments that are specified with
2065 operand number specifications, normally warnings are still given, since the implementation could not know what type to pass to
2067 to skip the unused arguments.
2068 However, in the case of
2070 formats, this option will suppress the warning if the unused arguments are all pointers, since the Single Unix Specification says that such unused arguments are allowed.
2072 .It Fl Wno-format-zero-length
2075 is specified, do not warn about zero-length formats.
2076 The C standard specifies that zero-length formats are allowed.
2078 .It Fl Wformat-nonliteral
2081 is specified, also warn if the format string is not a string literal and so cannot be checked, unless the format function takes its format arguments as a
2084 .It Fl Wformat-security
2087 is specified, also warn about uses of format functions that represent possible security problems.
2088 At present, this warns about calls to
2092 functions where the format string is not a string literal and there are no format arguments, as in
2094 This may be a security hole if the format string came from untrusted input and contains
2096 (This is currently a subset of what
2097 .Fl Wformat-nonliteral
2098 warns about, but in future warnings may be added to
2099 .Fl Wformat-security
2100 that are not included in
2101 .Fl Wformat-nonliteral . )
2106 plus format checks not included in
2108 Currently equivalent to
2109 .Fl Wformat Fl Wformat-nonliteral Fl Wformat-security Fl Wformat-y2k .
2112 Warn about passing a null pointer for arguments marked as requiring a non-null value by the
2121 It can be disabled with the
2125 .It Fl Winit-self (C, C++, Objective-C and Objective-C++ only)
2126 Warn about uninitialized variables which are initialized with themselves.
2127 Note this option can only be used with the
2129 option, which in turn only works with
2133 For example, GCC will warn about
2135 being uninitialized in the following snippet only when
2139 .Bd -literal -offset indent
2146 .It Fl Wimplicit-int
2147 Warn when a declaration does not specify a type.
2148 This warning is enabled by
2151 .It Fl Wimplicit-function-declaration
2152 .It Fl Werror-implicit-function-declaration
2153 Give a warning (or error) whenever a function is used before being declared.
2155 .Fl Wno-error-implicit-function-declaration
2157 This warning is enabled by
2159 (as a warning, not an error).
2165 .Fl Wimplicit-function-declaration .
2166 This warning is enabled by
2174 should be a function with external linkage, returning int, taking either zero arguments, two, or three arguments of appropriate types.
2175 This warning is enabled by
2178 .It Fl Wmissing-braces
2179 Warn if an aggregate or union initializer is not fully bracketed.
2180 In the following example, the initializer for
2182 is not fully bracketed, but that for
2186 .Bd -literal -offset indent
2187 int a[2][2] = { 0, 1, 2, 3 };
2188 int b[2][2] = { { 0, 1 }, { 2, 3 } };
2190 This warning is enabled by
2193 .It Fl Wmissing-include-dirs (C, C++, Objective-C and Objective-C++ only)
2194 Warn if a user-supplied include directory does not exist.
2197 Warn if parentheses are omitted in certain contexts, such as when there is an assignment in a context where a truth value is expected, or when operators are nested whose precedence people often get confused about.
2198 Only the warning for an assignment used as a truth value is supported when compiling C++; the other warnings are only supported when compiling C.
2200 Also warn if a comparison like
2201 .Sy x\*[Lt]=y\*[Lt]=z
2202 appears; this is equivalent to
2203 .Sy (x\*[Lt]=y ? 1 : 0) \*[Lt]= z ,
2204 which is a different interpretation from that of ordinary mathematical notation.
2206 Also warn about constructions where there may be confusion to which
2211 Here is an example of such a case:
2213 .Bd -literal -offset indent
2224 branch belongs to the innermost possible
2226 statement, which in this example is
2228 This is often not what the programmer expected, as illustrated in the above example by indentation the programmer chose.
2229 When there is the potential for this confusion, GCC will issue a warning when this flag is specified.
2230 To eliminate the warning, add explicit braces around the innermost
2232 statement so there is no way the
2234 could belong to the enclosing
2236 The resulting code would look like this:
2238 .Bd -literal -offset indent
2249 This warning is enabled by
2252 .It Fl Wsequence-point
2253 Warn about code that may have undefined semantics because of violations of sequence point rules in the C standard.
2255 The C standard defines the order in which expressions in a C program are evaluated in terms of
2256 .Em sequence points ,
2257 which represent a partial ordering between the execution of parts of the program: those executed before the sequence point, and those executed after it.
2258 These occur after the evaluation of a full expression (one which is not part of a larger expression), after the evaluation of the first operand of a
2264 (comma) operator, before a function is called (but after the evaluation of its arguments and the expression denoting the called function), and in certain other places.
2265 Other than as expressed by the sequence point rules, the order of evaluation of subexpressions of an expression is not specified.
2266 All these rules describe only a partial order rather than a total order, since, for example, if two functions are called within one expression with no sequence point between them, the order in which the functions are called is not specified.
2267 However, the standards committee have ruled that function calls do not overlap.
2269 It is not specified when between sequence points modifications to the values of objects take effect.
2270 Programs whose behavior depends on this have undefined behavior; the C standard specifies that "Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression.
2271 Furthermore, the prior value shall be read only to determine the value to be stored.".
2272 If a program breaks these rules, the results on any particular implementation are entirely unpredictable.
2274 Examples of code with undefined behavior are
2279 Some more complicated cases are not diagnosed by this option, and it may give an occasional false positive result, but in general it has been found fairly effective at detecting this sort of problem in programs.
2281 The present implementation of this option only works for C programs.
2282 A future implementation may also work for C++ programs.
2284 The C standard is worded confusingly, therefore there is some debate over the precise meaning of the sequence point rules in subtle cases.
2285 Links to discussions of the problem, including proposed formal definitions, may be found on the GCC readings page, at
2286 .Lk http://gcc.gnu.org/readings.html .
2288 This warning is enabled by
2292 Warn whenever a function is defined with a return-type that defaults to
2296 statement with no return-value in a function whose return-type is not
2299 For C, also warn if the return type of a function has a type qualifier such as
2301 Such a type qualifier has no effect, since the value returned by a function is not an lvalue.
2302 ISO C prohibits qualified
2304 return types on function definitions, so such return types always receive a warning even without this option.
2306 For C++, a function without return type always produces a diagnostic message, even when
2309 The only exceptions are
2311 and functions defined in system headers.
2313 This warning is enabled by
2319 statement has an index of enumerated type and lacks a
2321 for one or more of the named codes of that enumeration.
2324 label prevents this warning.)
2326 labels outside the enumeration range also provoke warnings when this option is used.
2327 This warning is enabled by
2330 .It Fl Wswitch-default
2333 statement does not have a
2340 statement has an index of enumerated type and lacks a
2342 for one or more of the named codes of that enumeration.
2344 labels outside the enumeration range also provoke warnings when this option is used.
2347 Warn if any trigraphs are encountered that might change the meaning of the program (trigraphs within comments are not warned about).
2348 This warning is enabled by
2351 .It Fl Wunused-function
2352 Warn whenever a static function is declared but not defined or a non-inline static function is unused.
2353 This warning is enabled by
2356 .It Fl Wunused-label
2357 Warn whenever a label is declared but not used.
2358 This warning is enabled by
2361 To suppress this warning use the
2365 .It Fl Wunused-parameter
2366 Warn whenever a function parameter is unused aside from its declaration.
2368 To suppress this warning use the
2372 .It Fl Wunused-variable
2373 Warn whenever a local variable or non-constant static variable is unused aside from its declaration.
2374 This warning is enabled by
2377 To suppress this warning use the
2381 .It Fl Wunused-value
2382 Warn whenever a statement computes a result that is explicitly not used.
2383 This warning is enabled by
2386 To suppress this warning cast the expression to
2394 In order to get a warning about an unused function parameter, you must either specify
2395 .Fl Wextra Fl Wunused
2400 or separately specify
2401 .Fl Wunused-parameter .
2403 .It Fl Wuninitialized
2404 Warn if an automatic variable is used without first being initialized or if a variable may be clobbered by a
2408 These warnings are possible only in optimizing compilation, because they require data flow information that is computed only when optimizing.
2409 If you don't specify
2411 you simply won't get these warnings.
2413 If you want to warn about code which uses the uninitialized value of the variable in its own initializer, use the
2417 These warnings occur for individual uninitialized or clobbered elements of structure, union or array variables as well as for variables which are uninitialized or clobbered as a whole.
2418 They do not occur for variables or elements declared
2420 Because these warnings depend on optimization, the exact variables or elements for which there are warnings will depend on the precise optimization options and version of GCC used.
2422 Note that there may be no warning about a variable that is used only to compute a value that itself is never used, because such computations may be deleted by data flow analysis before the warnings are printed.
2424 These warnings are made optional because GCC is not smart enough to see all the reasons why the code might be correct despite appearing to have an error.
2425 Here is one example of how this can happen:
2427 .Bd -literal -offset indent
2443 is always 1, 2 or 3, then
2445 is always initialized, but GCC doesn't know this.
2446 Here is another common case:
2448 .Bd -literal -offset indent
2451 if (change_y) save_y = y, y = new_y;
2453 if (change_y) y = save_y;
2456 This has no bug because
2458 is used only if it is set.
2460 This option also warns when a non-volatile automatic variable might be changed by a call to
2462 These warnings as well are possible only in optimizing compilation.
2464 The compiler sees only the calls to
2466 It cannot know where
2468 will be called; in fact, a signal handler could call it at any point in the code.
2469 As a result, you may get a warning even when there is in fact no problem because
2471 cannot in fact be called at the place which would cause a problem.
2473 Some spurious warnings can be avoided if you declare all the functions you use that never return as
2476 This warning is enabled by
2479 .It Fl Wunknown-pragmas
2480 Warn when a #pragma directive is encountered which is not understood by GCC.
2481 If this command line option is used, warnings will even be issued for unknown pragmas in system header files.
2482 This is not the case if the warnings were only enabled by the
2484 command line option.
2487 Do not warn about misuses of pragmas, such as incorrect parameters, invalid syntax, or conflicts between pragmas.
2489 .Fl Wunknown-pragmas .
2491 .It Fl Wstrict-aliasing
2492 This option is only active when
2493 .Fl fstrict-aliasing
2495 It warns about code which might break the strict aliasing rules that the compiler is using for optimization.
2496 The warning does not catch all cases, but does attempt to catch the more common pitfalls.
2500 .It Fl Wstrict-aliasing=2
2501 This option is only active when
2502 .Fl fstrict-aliasing
2504 It warns about code which might break the strict aliasing rules that the compiler is using for optimization.
2505 This warning catches more cases than
2506 .Fl Wstrict-aliasing ,
2507 but it will also give a warning for some ambiguous cases that are safe.
2513 This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros.
2514 This also enables some language-specific warnings described in
2515 .Sy C++ Dialect Options
2517 .Sy Objective-C and Objective-C++ Dialect Options .
2522 options are not implied by
2524 Some of them warn about constructions that users generally do not consider questionable, but which occasionally you might wish to check for; others warn about constructions that are necessary or hard to avoid in some cases, and there is no simple way to modify the code to suppress the warning.
2528 (This option used to be called
2530 The older name is still supported, but the newer name is more descriptive.) Print extra warning messages for these events:
2534 A function can return either with or without a value.
2535 (Falling off the end of the function body is considered returning without a value.) For example, this function would evoke such a warning:
2537 .Bd -literal -offset indent
2545 An expression-statement or the left-hand side of a comma expression contains no side effects.
2546 To suppress the warning, cast the unused expression to void.
2547 For example, an expression such as
2549 will cause a warning, but
2554 An unsigned value is compared against zero with
2560 Storage-class specifiers like
2562 are not the first things in a declaration.
2563 According to the C Standard, this usage is obsolescent.
2570 is also specified, warn about unused arguments.
2573 A comparison between signed and unsigned values could produce an incorrect result when the signed value is converted to unsigned.
2575 .Fl Wno-sign-compare
2579 An aggregate has an initializer which does not initialize all members.
2580 This warning can be independently controlled by
2581 .Fl Wmissing-field-initializers .
2584 A function parameter is declared without a type specifier in K&R-style functions:
2586 .Bd -literal -offset indent
2590 An empty body occurs in an
2597 A pointer is compared against integer zero with
2605 A variable might be changed by
2611 Any of several floating-point events that often indicate errors, such as overflow, underflow, loss of precision, etc.
2614 An enumerator and a non-enumerator both appear in a conditional expression.
2617 A non-static reference or non-static
2619 member appears in a class without constructors.
2622 Ambiguous virtual bases.
2625 Subscripting an array which has been declared
2629 Taking the address of a variable which has been declared
2633 A base class is not initialized in a derived class' copy constructor.
2636 .It Fl Wno-div-by-zero
2637 Do not warn about compile-time integer division by zero.
2638 Floating point division by zero is not warned about, as it can be a legitimate way of obtaining infinities and NaNs.
2640 .It Fl Wsystem-headers
2641 Print warning messages for constructs found in system header files.
2642 Warnings from system headers are normally suppressed, on the assumption that they usually do not indicate real problems and would only make the compiler output harder to read.
2643 Using this command line option tells GCC to emit warnings from system headers as if they occurred in user code.
2644 However, note that using
2646 in conjunction with this option will
2648 warn about unknown pragmas in system headers---for that,
2649 .Fl Wunknown-pragmas
2653 Warn if floating point values are used in equality comparisons.
2655 The idea behind this is that sometimes it is convenient (for the programmer) to consider floating-point values as approximations to infinitely precise real numbers.
2656 If you are doing this, then you need to compute (by analyzing the code, or in some other way) the maximum or likely maximum error that the computation introduces, and allow for it when performing comparisons (and when producing output, but that's a different problem).
2657 In particular, instead of testing for equality, you would check to see whether the two values have ranges that overlap; and this is done with the relational operators, so equality comparisons are probably mistaken.
2659 .It Fl Wtraditional (C only)
2660 Warn about certain constructs that behave differently in traditional and ISO C.
2661 Also warn about ISO C constructs that have no traditional C equivalent, and/or problematic constructs which should be avoided.
2665 Macro parameters that appear within string literals in the macro body.
2666 In traditional C macro replacement takes place within string literals, but does not in ISO C.
2669 In traditional C, some preprocessor directives did not exist.
2670 Traditional preprocessors would only consider a line to be a directive if the
2672 appeared in column 1 on the line.
2675 warns about directives that traditional C understands but would ignore because the
2677 does not appear as the first character on the line.
2678 It also suggests you hide directives like
2680 not understood by traditional C by indenting them.
2681 Some traditional implementations would not recognize
2683 so it suggests avoiding it altogether.
2686 A function-like macro that appears without arguments.
2689 The unary plus operator.
2694 integer constant suffix, or the
2698 floating point constant suffixes.
2699 (Traditional C does support the
2701 suffix on integer constants.) Note, these suffixes appear in macros defined in the system headers of most modern systems, e.g. the
2706 .Va \*[Lt]limits.h\*[Gt] .
2707 Use of these macros in user code might normally lead to spurious warnings, however GCC's integrated preprocessor has enough context to avoid warning in these cases.
2710 A function declared external in one block and then used after the end of the block.
2715 statement has an operand of type
2721 function declaration follows a
2724 This construct is not accepted by some traditional C compilers.
2727 The ISO type of an integer constant has a different width or signedness from its traditional type.
2728 This warning is only issued if the base of the constant is ten.
2729 I.e. hexadecimal or octal values, which typically represent bit patterns, are not warned about.
2732 Usage of ISO string concatenation is detected.
2735 Initialization of automatic aggregates.
2738 Identifier conflicts with labels.
2739 Traditional C lacks a separate namespace for labels.
2742 Initialization of unions.
2743 If the initializer is zero, the warning is omitted.
2744 This is done under the assumption that the zero initializer in user code appears conditioned on e.g.
2746 to avoid missing initializer warnings and relies on default initialization to zero in the traditional C case.
2749 Conversions by prototypes between fixed/floating point values and vice versa.
2750 The absence of these prototypes when compiling with traditional C would cause serious problems.
2751 This is a subset of the possible conversion warnings, for the full set use
2755 Use of ISO C style function definitions.
2756 This warning intentionally is
2758 issued for prototype declarations or variadic functions because these ISO C features will appear in your code when using libiberty's traditional C compatibility macros,
2762 This warning is also bypassed for nested functions because that feature is already a GCC extension and thus not relevant to traditional C compatibility.
2765 .It Fl Wdeclaration-after-statement (C only)
2766 Warn when a declaration is found after a statement in a block.
2767 This construct, known from C++, was introduced with ISO C99 and is by default allowed in GCC.
2768 It is not supported by ISO C90 and was not supported by GCC versions before GCC 3.0.
2771 Warn if an undefined identifier is evaluated in an
2775 .It Fl Wno-endif-labels
2776 Do not warn whenever an
2780 are followed by text.
2783 Warn whenever a local variable shadows another local variable, parameter or global variable or whenever a built-in function is shadowed.
2785 .It Fl Wlarger-than- Ns Ar len
2786 Warn whenever an object of larger than
2790 .It Fl Wunsafe-loop-optimizations
2791 Warn if the loop cannot be optimized because the compiler could not assume anything on the bounds of the loop indices.
2793 .Fl funsafe-loop-optimizations
2794 warn if the compiler made such assumptions.
2796 .It Fl Wpointer-arith
2797 Warn about anything that depends on the "size of" a function type or of
2799 GNU C assigns these types a size of 1, for convenience in calculations with
2801 pointers and pointers to functions.
2803 .It Fl Wbad-function-cast (C only)
2804 Warn whenever a function call is cast to a non-matching type.
2805 For example, warn if
2811 Warn about ISO C constructs that are outside of the common subset of ISO C and ISO C++, e.g. request for implicit conversion from
2813 to a pointer to non-
2818 Warn whenever a pointer is cast so as to remove a type qualifier from the target type.
2819 For example, warn if a
2821 is cast to an ordinary
2825 Warn whenever a pointer is cast such that the required alignment of the target is increased.
2826 For example, warn if a
2830 on machines where integers can only be accessed at two- or four-byte boundaries.
2832 .It Fl Wwrite-strings
2833 When compiling C, give string constants the type C<const char
2835 > so that copying the address of one into a non-
2838 pointer will get a warning; when compiling C++, warn about the deprecated conversion from string constants to
2840 These warnings will help you find at compile time code that can try to write into a string constant, but only if you have been very careful about using
2842 in declarations and prototypes.
2843 Otherwise, it will just be a nuisance; this is why we did not make
2845 request these warnings.
2848 Warn if a prototype causes a type conversion that is different from what would happen to the same argument in the absence of a prototype.
2849 This includes conversions of fixed point to floating and vice versa, and conversions changing the width or signedness of a fixed point argument except when the same as the default promotion.
2851 Also, warn if a negative integer constant expression is implicitly converted to an unsigned type.
2852 For example, warn about the assignment
2857 But do not warn about explicit casts like
2860 .It Fl Wsign-compare
2861 Warn when a comparison between signed and unsigned values could produce an incorrect result when the signed value is converted to unsigned.
2862 This warning is also enabled by
2864 to get the other warnings of
2866 without this warning, use
2867 .Fl Wextra Fl Wno-sign-compare .
2869 .It Fl Waggregate-return
2870 Warn if any functions that return structures or unions are defined or called.
2871 (In languages where you can return an array, this also elicits a warning.)
2873 .It Fl Wno-attributes
2874 Do not warn if an unexpected
2876 is used, such as unrecognized attributes, function attributes applied to variables, etc.
2877 This will not stop errors for incorrect use of supported attributes.
2879 .It Fl Wstrict-prototypes (C only)
2880 Warn if a function is declared or defined without specifying the argument types.
2881 (An old-style function definition is permitted without a warning if preceded by a declaration which specifies the argument types.)
2883 .It Fl Wold-style-definition (C only)
2884 Warn if an old-style function definition is used.
2885 A warning is given even if there is a previous prototype.
2887 .It Fl Wmissing-prototypes (C only)
2888 Warn if a global function is defined without a previous prototype declaration.
2889 This warning is issued even if the definition itself provides a prototype.
2890 The aim is to detect global functions that fail to be declared in header files.
2892 .It Fl Wmissing-declarations (C only)
2893 Warn if a global function is defined without a previous declaration.
2894 Do so even if the definition itself provides a prototype.
2895 Use this option to detect global functions that are not declared in header files.
2897 .It Fl Wmissing-field-initializers
2898 Warn if a structure's initializer has some fields missing.
2899 For example, the following code would cause such a warning, because
2903 .Bd -literal -offset indent
2904 struct s { int f, g, h; };
2905 struct s x = { 3, 4 };
2907 This option does not warn about designated initializers, so the following modification would not trigger a warning:
2909 .Bd -literal -offset indent
2910 struct s { int f, g, h; };
2911 struct s x = { .f = 3, .g = 4 };
2913 This warning is included in
2917 warnings without this one, use
2918 .Fl Wextra Fl Wno-missing-field-initializers .
2920 .It Fl Wmissing-noreturn
2921 Warn about functions which might be candidates for attribute
2923 Note these are only possible candidates, not absolute ones.
2924 Care should be taken to manually verify functions actually do not ever return before adding the
2926 attribute, otherwise subtle code generation bugs could be introduced.
2927 You will not get a warning for
2929 in hosted C environments.
2931 .It Fl Wmissing-format-attribute
2932 Warn about function pointers which might be candidates for
2935 Note these are only possible candidates, not absolute ones.
2936 GCC will guess that function pointers with
2938 attributes that are used in assignment, initialization, parameter passing or return statements should have a corresponding
2940 attribute in the resulting type.
2941 I.e. the left-hand side of the assignment or initialization, the type of the parameter variable, or the return type of the containing function respectively should also have a
2943 attribute to avoid the warning.
2945 GCC will also warn about function definitions which might be candidates for
2948 Again, these are only possible candidates.
2951 attributes might be appropriate for any function that calls a function like
2955 but this might not always be the case, and some functions for which
2957 attributes are appropriate may not be detected.
2959 .It Fl Wno-multichar
2960 Do not warn if a multicharacter constant
2963 Usually they indicate a typo in the user's code, as they have implementation-defined values, and should not be used in portable code.
2965 .It Sy -Wnormalized=\*[Lt]none|id|nfc|nfkc\*[Gt] Ns
2966 In ISO C and ISO C++, two identifiers are different if they are different sequences of characters.
2967 However, sometimes when characters outside the basic ASCII character set are used, you can have two different character sequences that look the same.
2968 To avoid confusion, the ISO 10646 standard sets out some
2969 .Em normalization rules
2970 which when applied ensure that two sequences that look the same are turned into the same sequence.
2971 GCC can warn you if you are using identifiers which have not been normalized; this option controls that warning.
2973 There are four levels of warning that GCC supports.
2975 .Fl Wnormalized=nfc ,
2976 which warns about any identifier which is not in the ISO 10646 "C" normalized form,
2978 NFC is the recommended form for most uses.
2980 Unfortunately, there are some characters which ISO C and ISO C++ allow in identifiers that when turned into NFC aren't allowable as identifiers.
2981 That is, there's no way to use these symbols in portable ISO C or C++ and have all your identifiers in NFC.
2983 suppresses the warning for these characters.
2984 It is hoped that future versions of the standards involved will correct this, which is why this option is not the default.
2986 You can switch the warning off for all characters by writing
2987 .Fl Wnormalized=none .
2988 You would only want to do this if you were using some other normalization scheme (like "D"), because otherwise you can easily create bugs that are literally impossible to see.
2990 Some characters in ISO 10646 have distinct meanings but look identical in some fonts or display methodologies, especially once formatting has been applied.
2993 "SUPERSCRIPT LATIN SMALL LETTER N", will display just like a regular
2995 which has been placed in a superscript.
2996 ISO 10646 defines the
2998 normalisation scheme to convert all these into a standard form as well, and GCC will warn if your code is not in NFKC if you use
2999 .Fl Wnormalized=nfkc .
3000 This warning is comparable to warning about every identifier that contains the letter O because it might be confused with the digit 0, and so is not the default, but may be useful as a local coding convention if the programming environment is unable to be fixed to display these characters distinctly.
3002 .It Fl Wno-deprecated-declarations
3003 Do not warn about uses of functions, variables, and types marked as deprecated by using the
3006 (@pxref{Function Attributes}, @pxref{Variable Attributes}, @pxref{Type Attributes}.)
3009 Warn if a structure is given the packed attribute, but the packed attribute has no effect on the layout or size of the structure.
3010 Such structures may be mis-aligned for little benefit.
3011 For instance, in this code, the variable
3015 will be misaligned even though
3017 does not itself have the packed attribute:
3019 .Bd -literal -offset indent
3023 } __attribute__((packed));
3030 Warn if padding is included in a structure, either to align an element of the structure or to align the whole structure.
3031 Sometimes when this happens it is possible to rearrange the fields of the structure to reduce the padding and so make the structure smaller.
3033 .It Fl Wredundant-decls
3034 Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing.
3036 .It Fl Wnested-externs (C only)
3039 declaration is encountered within a function.
3041 .It Fl Wunreachable-code
3042 Warn if the compiler detects that code will never be executed.
3044 This option is intended to warn when the compiler detects that at least a whole line of source code will never be executed, because some condition is never satisfied or because it is after a procedure that never returns.
3046 It is possible for this option to produce a warning even though there are circumstances under which part of the affected line can be executed, so care should be taken when removing apparently-unreachable code.
3048 For instance, when a function is inlined, a warning may mean that the line is unreachable in only one inlined copy of the function.
3050 This option is not made part of
3052 because in a debugging version of a program there is often substantial code which checks correct functioning of the program and is, hopefully, unreachable because the program does work.
3053 Another common use of unreachable code is to provide behavior which is selectable at compile-time.
3056 Warn if a function can not be inlined and it was declared as inline.
3057 Even with this option, the compiler will not warn about failures to inline functions declared in system headers.
3059 The compiler uses a variety of heuristics to determine whether or not to inline a function.
3060 For example, the compiler takes into account the size of the function being inlined and the amount of inlining that has already been done in the current function.
3061 Therefore, seemingly insignificant changes in the source program can cause the warnings produced by
3063 to appear or disappear.
3065 .It Fl Wno-invalid-offsetof (C++ only)
3066 Suppress warnings from applying the
3068 macro to a non-POD type.
3069 According to the 1998 ISO C++ standard, applying
3071 to a non-POD type is undefined.
3072 In existing C++ implementations, however,
3074 typically gives meaningful results even when applied to certain kinds of non-POD types. (Such as a simple
3076 that fails to be a POD type only by virtue of having a constructor.) This flag is for users who are aware that they are writing nonportable code and who have deliberately chosen to ignore the warning about it.
3080 may be relaxed in a future version of the C++ standard.
3082 .It Fl Wno-int-to-pointer-cast (C only)
3083 Suppress warnings from casts to pointer type of an integer of a different size.
3085 .It Fl Wno-pointer-to-int-cast (C only)
3086 Suppress warnings from casts from a pointer to an integer type of a different size.
3089 Warn if a precompiled header is found in the search path but can't be used.
3096 To inhibit the warning messages, use
3102 are taken into account only when
3106 .It Fl Wvariadic-macros
3107 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU alternate syntax when in pedantic ISO C99 mode.
3109 To inhibit the warning messages, use
3110 .Fl Wno-variadic-macros .
3112 .It Fl Wvolatile-register-var
3113 Warn if a register variable is declared volatile.
3114 The volatile modifier does not inhibit all optimizations that may eliminate reads and/or writes to register variables.
3116 .It Fl Wdisabled-optimization
3117 Warn if a requested optimization pass is disabled.
3118 This warning does not generally indicate that there is anything wrong with your code; it merely indicates that GCC's optimizers were unable to handle the code effectively.
3119 Often, the problem is that your code is too big or too complex; GCC will refuse to optimize programs when the optimization itself is likely to take inordinate amounts of time.
3121 .It Fl Wpointer-sign
3122 Warn for pointer argument passing or assignment with different signedness.
3123 This option is only supported for C and Objective-C.
3128 which can be disabled with
3129 .Fl Wno-pointer-sign .
3132 Make all warnings into errors.
3134 .It Fl Wstack-protector
3135 This option is only active when
3136 .Fl fstack-protector
3138 It warns about functions that will not be protected against stack smashing.
3141 .Ss Options for Debugging Your Program or GCC
3142 GCC has various special options that are used for debugging either your program or GCC:
3146 Produce debugging information in the operating system's native format (stabs, COFF, XCOFF, or DWARF 2).
3147 GDB can work with this debugging information.
3149 On most systems that use stabs format,
3151 enables use of extra debugging information that only GDB can use; this extra information makes debugging work better in GDB but will probably make other debuggers crash or refuse to read the program.
3152 If you want to control for certain whether to generate the extra information, use
3161 GCC allows you to use
3165 The shortcuts taken by optimized code may occasionally produce surprising results: some variables you declared may not exist at all; flow of control may briefly move where you did not expect it; some statements may not be executed because they compute constant results or their values were already at hand; some statements may execute in different places because they were moved out of loops.
3167 Nevertheless it proves possible to debug optimized output.
3168 This makes it reasonable to use the optimizer for programs that might have bugs.
3170 The following options are useful when GCC is generated with the capability for more than one debugging format.
3173 Produce debugging information for use by GDB.
3174 This means to use the most expressive format available (DWARF 2, stabs, or the native format if neither of those are supported), including GDB extensions if at all possible.
3177 Produce debugging information in stabs format (if that is supported), without GDB extensions.
3178 This is the format used by DBX on most BSD systems.
3179 On MIPS, Alpha and System V Release 4 systems this option produces stabs debugging output which is not understood by DBX or SDB.
3180 On System V Release 4 systems this option requires the GNU assembler.
3182 .It Fl feliminate-unused-debug-symbols
3183 Produce debugging information in stabs format (if that is supported), for only symbols that are actually used.
3186 Produce debugging information in stabs format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB).
3187 The use of these extensions is likely to make other debuggers crash or refuse to read the program.
3190 Produce debugging information in COFF format (if that is supported).
3191 This is the format used by SDB on most System V systems prior to System V Release 4.
3194 Produce debugging information in XCOFF format (if that is supported).
3195 This is the format used by the DBX debugger on IBM RS/6000 systems.
3198 Produce debugging information in XCOFF format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB).
3199 The use of these extensions is likely to make other debuggers crash or refuse to read the program, and may cause assemblers other than the GNU assembler (GAS) to fail with an error.
3202 Produce debugging information in DWARF version 2 format (if that is supported).
3203 This is the format used by DBX on IRIX 6.
3204 With this option, GCC uses features of DWARF version 3 when they are useful; version 3 is upward compatible with version 2, but may still cause problems for older debuggers.
3207 Produce debugging information in VMS debug format (if that is supported).
3208 This is the format used by DEBUG on VMS systems.
3210 .It Fl g Ns Ar level
3211 .It Fl ggdb Ns Ar level
3212 .It Fl gstabs Ns Ar level
3213 .It Fl gcoff Ns Ar level
3214 .It Fl gxcoff Ns Ar level
3215 .It Fl gvms Ns Ar level
3216 Request debugging information and also use
3218 to specify how much information.
3219 The default level is 2.
3221 Level 1 produces minimal information, enough for making backtraces in parts of the program that you don't plan to debug.
3222 This includes descriptions of functions and external variables, but no information about local variables and no line numbers.
3224 Level 3 includes extra information, such as all the macro definitions present in the program.
3225 Some debuggers support macro expansion when you use
3229 does not accept a concatenated debug level, because GCC used to support an option
3231 that meant to generate debug information in version 1 of the DWARF format (which is very different from version 2), and it would have been too confusing.
3232 That debug format is long obsolete, but the option cannot be changed now.
3233 Instead use an additional
3235 option to change the debug level for DWARF2.
3237 .It Fl feliminate-dwarf2-dups
3238 Compress DWARF2 debugging information by eliminating duplicated information about each symbol.
3239 This option only makes sense when generating DWARF2 debugging information with
3243 Generate extra code to write profile information suitable for the analysis program
3245 You must use this option when compiling the source files you want data about, and you must also use it when linking.
3248 Generate extra code to write profile information suitable for the analysis program
3250 You must use this option when compiling the source files you want data about, and you must also use it when linking.
3253 Makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes.
3256 Makes the compiler print some statistics about the time consumed by each pass when it finishes.
3259 Makes the compiler print some statistics about permanent memory allocation when it finishes.
3261 .It Fl fprofile-arcs
3262 Add code so that program flow
3265 During execution the program records how many times each branch and call is executed and how many times it is taken or returns.
3266 When the compiled program exits it saves this data to a file called
3268 for each source file.
3269 The data may be used for profile-directed optimizations
3270 .Fl ( fbranch-probabilities ) ,
3271 or for test coverage analysis
3272 .Fl ( ftest-coverage ) .
3275 is generated from the name of the output file, if explicitly specified and it is not the final executable, otherwise it is the basename of the source file.
3276 In both cases any suffix is removed (e.g.
3282 for output file specified as
3283 .Sy -o dir/foo.o ) .
3286 This option is used to compile and link code instrumented for coverage analysis.
3287 The option is a synonym for
3290 (when compiling) and
3293 See the documentation for those options for more details.
3297 Compile the source files with
3299 plus optimization and code generation options.
3300 For test coverage analysis, use the additional
3303 You do not need to profile every source file in a program.
3306 Link your object files with
3310 (the latter implies the former).
3313 Run the program on a representative workload to generate the arc profile information.
3314 This may be repeated any number of times.
3315 You can run concurrent instances of your program, and provided that the file system supports locking, the data files will be correctly updated.
3318 calls are detected and correctly handled (double counting will not happen).
3321 For profile-directed optimizations, compile the source files again with the same optimization and code generation options plus
3322 .Fl fbranch-probabilities .
3325 For test coverage analysis, use
3327 to produce human readable information from the
3334 documentation for further information.
3339 for each function of your program GCC creates a program flow graph, then finds a spanning tree for the graph.
3340 Only arcs that are not on the spanning tree have to be instrumented: the compiler adds code to count the number of times that these arcs are executed.
3341 When an arc is the only exit or only entrance to a block, the instrumentation code can be added to the block; otherwise, a new basic block must be created to hold the instrumentation code.
3343 .It Fl ftest-coverage
3344 Produce a notes file that the
3346 code-coverage utility can use to show program coverage.
3347 Each source file's note file is called
3351 option above for a description of
3353 and instructions on how to generate test coverage data.
3354 Coverage data will match the source files more closely, if you do not optimize.
3356 .It Fl d Ns Ar letters
3357 .It Fl fdump-rtl- Ns Ar pass
3358 Says to make debugging dumps during compilation at times specified by
3360 This is used for debugging the RTL-based passes of the compiler.
3361 The file names for most of the dumps are made by appending a pass number and a word to the
3364 is generated from the name of the output file, if explicitly specified and it is not an executable, otherwise it is the basename of the source file.
3366 Most debug dumps can be enabled either passing a letter to the
3368 option, or with a long
3370 switch; here are the possible letters for use in
3378 Annotate the assembler output with miscellaneous debugging information.
3382 Dump after computing branch probabilities, to
3386 .It Fl fdump-rtl-bbro
3387 Dump after block reordering, to
3391 .It Fl fdump-rtl-combine
3392 Dump after instruction combination, to the file
3393 .Pa file.17.combine .
3396 .It Fl fdump-rtl-ce1
3397 .It Fl fdump-rtl-ce2
3401 enable dumping after the first if conversion, to the file
3406 enable dumping after the second if conversion, to the file
3410 .It Fl fdump-rtl-btl
3411 .It Fl fdump-rtl-dbr
3415 enable dumping after branch target load optimization, to
3420 enable dumping after delayed branch scheduling, to
3424 Dump all macro definitions, at the end of preprocessing, in addition to normal output.
3427 .It Fl fdump-rtl-ce3
3428 Dump after the third if conversion, to
3432 .It Fl fdump-rtl-cfg
3433 .It Fl fdump-rtl-life
3437 enable dumping after control and data flow analysis, to
3442 enable dumping dump after life analysis, to
3446 .It Fl fdump-rtl-greg
3447 Dump after global register allocation, to
3451 .It Fl fdump-rtl-gcse
3452 .It Fl fdump-rtl-bypass
3456 enable dumping after GCSE, to
3460 .Fl fdump-rtl-bypass
3461 enable dumping after jump bypassing and control flow optimizations, to
3462 .Pa file.07.bypass .
3466 Dump after finalization of EH handling code, to
3470 .It Fl fdump-rtl-sibling
3471 Dump after sibling call optimizations, to
3472 .Pa file.01.sibling .
3475 .It Fl fdump-rtl-jump
3476 Dump after the first jump optimization, to
3480 .It Fl fdump-rtl-stack
3481 Dump after conversion from registers to stack, to
3485 .It Fl fdump-rtl-lreg
3486 Dump after local register allocation, to
3490 .It Fl fdump-rtl-loop
3491 .It Fl fdump-rtl-loop2
3495 enable dumping after the first loop optimization pass, to
3500 enable dumping after the second pass, to
3504 .It Fl fdump-rtl-sms
3505 Dump after modulo scheduling, to
3509 .It Fl fdump-rtl-mach
3510 Dump after performing the machine dependent reorganization pass, to
3514 .It Fl fdump-rtl-rnreg
3515 Dump after register renumbering, to
3519 .It Fl fdump-rtl-regmove
3520 Dump after the register move pass, to
3521 .Pa file.19.regmove .
3524 .It Fl fdump-rtl-postreload
3525 Dump after post-reload optimizations, to
3526 .Pa file.24.postreload .
3529 .It Fl fdump-rtl-expand
3530 Dump after RTL generation, to
3531 .Pa file.00.expand .
3534 .It Fl fdump-rtl-sched2
3535 Dump after the second scheduling pass, to
3536 .Pa file.32.sched2 .
3539 .It Fl fdump-rtl-cse
3540 Dump after CSE (including the jump optimization that sometimes follows CSE), to
3544 .It Fl fdump-rtl-sched
3545 Dump after the first scheduling pass, to
3549 .It Fl fdump-rtl-cse2
3550 Dump after the second CSE pass (including the jump optimization that sometimes follows CSE), to
3554 .It Fl fdump-rtl-tracer
3555 Dump after running tracer, to
3556 .Pa file.12.tracer .
3559 .It Fl fdump-rtl-vpt
3560 .It Fl fdump-rtl-vartrack
3564 enable dumping after the value profile transformations, to
3568 .Fl fdump-rtl-vartrack
3569 enable dumping after variable tracking, to
3570 .Pa file.34.vartrack .
3573 .It Fl fdump-rtl-flow2
3574 Dump after the second flow pass, to
3578 .It Fl fdump-rtl-peephole2
3579 Dump after the peephole pass, to
3580 .Pa file.27.peephole2 .
3583 .It Fl fdump-rtl-web
3584 Dump after live range splitting, to
3588 .It Fl fdump-rtl-all
3589 Produce all the dumps listed above.
3592 Produce a core dump whenever an error occurs.
3595 Print statistics on memory usage, at the end of the run, to standard error.
3598 Annotate the assembler output with a comment indicating which pattern and alternative was used.
3599 The length of each instruction is also printed.
3602 Dump the RTL in the assembler output as a comment before each instruction.
3608 For each of the other indicated dump files (either with
3611 .Fl fdump-rtl- Ns Ar pass ) ,
3612 dump a representation of the control flow graph suitable for viewing with VCG to
3616 Just generate RTL for a function instead of compiling it.
3619 .Fl ( fdump-rtl-expand ) .
3622 Dump debugging information during parsing, to standard error.
3625 .It Fl fdump-unnumbered
3626 When doing debugging dumps (see
3628 option above), suppress instruction numbers and line number note output.
3629 This makes it more feasible to use diff on debugging dumps for compiler invocations with different options, in particular with and without
3632 .It Fl fdump-translation-unit (C++ only)
3633 .It Fl fdump-translation-unit- Ns Ar options \~(C++ only)
3634 Dump a representation of the tree structure for the entire translation unit to a file.
3635 The file name is made by appending
3637 to the source file name.
3643 controls the details of the dump as described for the
3647 .It Fl fdump-class-hierarchy (C++ only)
3648 .It Fl fdump-class-hierarchy- Ns Ar options \~(C++ only)
3649 Dump a representation of each class's hierarchy and virtual function table layout to a file.
3650 The file name is made by appending
3652 to the source file name.
3658 controls the details of the dump as described for the
3662 .It Fl fdump-ipa- Ns Ar switch
3663 Control the dumping at various stages of inter-procedural analysis language tree to a file.
3664 The file name is generated by appending a switch specific suffix to the source file name.
3665 The following dumps are possible:
3669 Enables all inter-procedural analysis dumps; currently the only produced dump is the
3674 Dumps information about call-graph optimization, unused function removal, and inlining decisions.
3677 .It Fl fdump-tree- Ns Ar switch
3678 .It Fl fdump-tree- Ns Ar switch Ns - Ns Ar options
3679 Control the dumping at various stages of processing the intermediate language tree to a file.
3680 The file name is generated by appending a switch specific suffix to the source file name.
3688 separated options that control the details of the dump.
3689 Not all options are applicable to all dumps, those which are not meaningful will be ignored.
3690 The following options are available
3694 Print the address of each node.
3695 Usually this is not meaningful as it changes according to the environment and source file.
3696 Its primary use is for tying up a dump file with a debug environment.
3699 Inhibit dumping of members of a scope or body of a function merely because that scope has been reached.
3700 Only dump such items when they are directly reachable by some other path.
3701 When dumping pretty-printed trees, this option inhibits dumping the bodies of control structures.
3704 Print a raw representation of the tree.
3705 By default, trees are pretty-printed into a C-like representation.
3708 Enable more detailed dumps (not honored by every dump option).
3711 Enable dumping various statistics about the pass (not honored by every dump option).
3714 Enable showing basic block boundaries (disabled in raw dumps).
3717 Enable showing virtual operands for every statement.
3720 Enable showing line numbers for statements.
3723 Enable showing the unique ID
3728 Turn on all options, except
3735 The following tree dumps are possible:
3739 Dump before any tree based optimization, to
3743 Dump after all tree based optimization, to
3744 .Pa file.optimized .
3747 Dump after function inlining, to
3751 Dump each function before and after the gimplification pass to a file.
3752 The file name is made by appending
3754 to the source file name.
3757 Dump the control flow graph of each function to a file.
3758 The file name is made by appending
3760 to the source file name.
3763 Dump the control flow graph of each function to a file in VCG format.
3764 The file name is made by appending
3766 to the source file name.
3767 Note that if the file contains more than one function, the generated file cannot be used directly by VCG.
3768 You will need to cut and paste each function's graph into its own separate file first.
3771 Dump each function after copying loop headers.
3772 The file name is made by appending
3774 to the source file name.
3777 Dump SSA related information to a file.
3778 The file name is made by appending
3780 to the source file name.
3783 Dump structure aliasing variable information to a file.
3784 This file name is made by appending
3786 to the source file name.
3789 Dump aliasing information for each function.
3790 The file name is made by appending
3792 to the source file name.
3795 Dump each function after CCP.
3796 The file name is made by appending
3798 to the source file name.
3801 Dump each function after STORE-CCP.
3802 The file name is made by appending
3804 to the source file name.
3807 Dump trees after partial redundancy elimination.
3808 The file name is made by appending
3810 to the source file name.
3813 Dump trees after full redundancy elimination.
3814 The file name is made by appending
3816 to the source file name.
3819 Dump trees after copy propagation.
3820 The file name is made by appending
3822 to the source file name.
3824 .It Sy store_copyprop Ns
3825 Dump trees after store copy-propagation.
3826 The file name is made by appending
3828 to the source file name.
3831 Dump each function after dead code elimination.
3832 The file name is made by appending
3834 to the source file name.
3837 Dump each function after adding mudflap instrumentation.
3838 The file name is made by appending
3840 to the source file name.
3843 Dump each function after performing scalar replacement of aggregates.
3844 The file name is made by appending
3846 to the source file name.
3849 Dump each function after performing code sinking.
3850 The file name is made by appending
3852 to the source file name.
3855 Dump each function after applying dominator tree optimizations.
3856 The file name is made by appending
3858 to the source file name.
3861 Dump each function after applying dead store elimination.
3862 The file name is made by appending
3864 to the source file name.
3867 Dump each function after optimizing PHI nodes into straightline code.
3868 The file name is made by appending
3870 to the source file name.
3873 Dump each function after forward propagating single use variables.
3874 The file name is made by appending
3876 to the source file name.
3878 .It Sy copyrename Ns
3879 Dump each function after applying the copy rename optimization.
3880 The file name is made by appending
3882 to the source file name.
3885 Dump each function after applying the named return value optimization on generic trees.
3886 The file name is made by appending
3888 to the source file name.
3891 Dump each function after applying vectorization of loops.
3892 The file name is made by appending
3894 to the source file name.
3897 Dump each function after Value Range Propagation (VRP).
3898 The file name is made by appending
3900 to the source file name.
3903 Enable all the available tree dumps with the flags provided in this option.
3906 .It Fl ftree-vectorizer-verbose= Ns Ar n
3907 This option controls the amount of debugging output the vectorizer prints.
3908 This information is written to standard error, unless
3912 is specified, in which case it is output to the usual dump listing file,
3915 .It Fl frandom-seed= Ns Ar string
3916 This option provides a seed that GCC uses when it would otherwise use random numbers.
3917 It is used to generate certain symbol names that have to be different in every compiled file.
3918 It is also used to place unique stamps in coverage data files and the object files that produce them.
3921 option to produce reproducibly identical object files.
3925 should be different for every file you compile.
3927 .It Fl fsched-verbose= Ns Ar n
3928 On targets that use instruction scheduling, this option controls the amount of debugging output the scheduler prints.
3929 This information is written to standard error, unless
3933 is specified, in which case it is output to the usual dump listing file,
3940 greater than nine, the output is always printed to standard error.
3946 outputs the same information as
3950 greater than one, it also output basic block probabilities, detailed ready list information and unit/insn info.
3953 greater than two, it includes RTL at abort point, control-flow and regions info.
3958 also includes dependence info.
3961 Store the usual "temporary" intermediate files permanently; place them in the current directory and name them based on the source file.
3972 This creates a preprocessed
3974 output file even though the compiler now normally uses an integrated preprocessor.
3976 When used in combination with the
3978 command line option,
3980 is sensible enough to avoid over writing an input source file with the same extension as an intermediate file.
3981 The corresponding intermediate file may be obtained by renaming the source file before using
3985 Report the CPU time taken by each subprocess in the compilation sequence.
3986 For C source files, this is the compiler proper and assembler (plus the linker if linking is done).
3987 The output looks like this:
3989 .Bd -literal -offset indent
3993 The first number on each line is the "user time", that is time spent executing the program itself.
3994 The second number is "system time", time spent executing operating system routines on behalf of the program.
3995 Both numbers are in seconds.
3997 .It Fl fvar-tracking
3998 Run variable tracking pass.
3999 It computes where variables are stored at each position in code.
4000 Better debugging information is then generated (if the debugging information format supports this information).
4002 It is enabled by default when compiling with optimization
4006 debugging information
4008 and the debug info format supports it.
4010 .It Fl print-file-name= Ns Ar library
4011 Print the full absolute name of the library file
4013 that would be used when linking---and don't do anything else.
4014 With this option, GCC does not compile or link anything; it just prints the file name.
4016 .It Fl print-multi-directory
4017 Print the directory name corresponding to the multilib selected by any other switches present in the command line.
4018 This directory is supposed to exist in
4019 .Sy GCC_EXEC_PREFIX .
4021 .It Fl print-multi-lib
4022 Print the mapping from multilib directory names to compiler switches that enable them.
4023 The directory name is separated from the switches by
4025 and each switch starts with an
4026 .Sy @} instead of the @samp{- ,
4027 without spaces between multiple switches.
4028 This is supposed to ease shell-processing.
4030 .It Fl print-prog-name= Ns Ar program
4032 .Fl print-file-name ,
4033 but searches for a program such as
4036 .It Fl print-libgcc-file-name
4038 .Sy -print-file-name=libgcc.a .
4040 This is useful when you use
4044 but you do want to link with
4048 .Bd -literal -offset indent
4049 gcc -nostdlib \*[Lt]files\*[Gt]... `gcc -print-libgcc-file-name`
4051 .It Fl print-search-dirs
4052 Print the name of the configured installation directory and a list of program and library directories
4054 will search---and don't do anything else.
4058 prints the error message
4059 .Sy installation problem, cannot exec cpp0: No such file or directory .
4060 To resolve this you either need to put
4062 and the other compiler components where
4064 expects to find them, or you can set the environment variable
4066 to the directory where you installed them.
4067 Don't forget the trailing
4071 Print the compiler's target machine (for example,
4072 .Sy i686-pc-linux-gnu )
4073 ---and don't do anything else.
4076 Print the compiler version (for example,
4078 ---and don't do anything else.
4081 Print the compiler's built-in specs---and don't do anything else.
4082 (This is used when GCC itself is being built.)
4084 .It Fl feliminate-unused-debug-types
4085 Normally, when producing DWARF2 output, GCC will emit debugging information for all types declared in a compilation unit, regardless of whether or not they are actually used in that compilation unit.
4086 Sometimes this is useful, such as if, in the debugger, you want to cast a value to a type that is not actually used in your program (but is declared).
4087 More often, however, this results in a significant amount of wasted space.
4088 With this option, GCC will avoid producing debug symbol output for types that are nowhere used in the source file being compiled.
4091 .Ss Options That Control Optimization
4092 These options control various sorts of optimizations.
4094 Without any optimization option, the compiler's goal is to reduce the cost of compilation and to make debugging produce the expected results.
4095 Statements are independent: if you stop the program with a breakpoint between statements, you can then assign a new value to any variable or change the program counter to any other statement in the function and get exactly the results you would expect from the source code.
4097 Turning on optimization flags makes the compiler attempt to improve the performance and/or code size at the expense of compilation time and possibly the ability to debug the program.
4099 The compiler performs optimization based on the knowledge it has of the program.
4102 and above, in particular, enable
4104 mode, which allows the compiler to consider information gained from later functions in the file when compiling a function.
4105 Compiling multiple files at once to a single output file in
4107 mode allows the compiler to use information gained from all of the files when compiling each of them.
4109 Not all optimizations are controlled directly by a flag.
4110 Only optimizations that have a flag are listed.
4116 Optimizing compilation takes somewhat more time, and a lot more memory for a large function.
4120 the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time.
4123 turns on the following optimization flags:
4124 .Fl fdefer-pop Fl fdelayed-branch Fl fguess-branch-probability Fl fcprop-registers Fl floop-optimize Fl fif-conversion Fl fif-conversion2 Fl ftree-ccp Fl ftree-dce Fl ftree-dominator-opts Fl ftree-dse Fl ftree-ter Fl ftree-lrs Fl ftree-sra Fl ftree-copyrename Fl ftree-fre Fl ftree-ch Fl funit-at-a-time Fl fmerge-constants
4128 .Fl fomit-frame-pointer
4129 on machines where doing so does not interfere with debugging.
4134 for the Ada compiler.
4135 This option must be explicitly specified on the command line to be enabled for the Ada compiler.
4139 GCC performs nearly all supported optimizations that do not involve a space-speed tradeoff.
4140 The compiler does not perform loop unrolling or function inlining when you specify
4144 this option increases both compilation time and the performance of the generated code.
4147 turns on all optimization flags specified by
4149 It also turns on the following optimization flags:
4150 .Fl fthread-jumps Fl fcrossjumping Fl foptimize-sibling-calls Fl fcse-follow-jumps Fl fcse-skip-blocks Fl fgcse Fl fgcse-lm Fl fexpensive-optimizations Fl fstrength-reduce Fl frerun-cse-after-loop Fl frerun-loop-opt Fl fcaller-saves Fl fpeephole2 Fl fschedule-insns Fl fschedule-insns2 Fl fsched-interblock Fl fsched-spec Fl fregmove Fl fstrict-aliasing Fl fdelete-null-pointer-checks Fl freorder-blocks Fl freorder-functions Fl falign-functions Fl falign-jumps Fl falign-loops Fl falign-labels Fl ftree-vrp Fl ftree-pre
4152 Please note the warning under
4156 on programs that use computed gotos.
4161 turns on all optimizations specified by
4163 and also turns on the
4164 .Fl finline-functions ,
4167 .Fl fgcse-after-reload
4172 This is the default.
4179 optimizations that do not typically increase code size.
4180 It also performs further optimizations designed to reduce code size.
4183 disables the following optimization flags:
4184 .Fl falign-functions Fl falign-jumps Fl falign-loops Fl falign-labels Fl freorder-blocks Fl freorder-blocks-and-partition Fl fprefetch-loop-arrays Fl ftree-vect-loop-version
4188 options, with or without level numbers, the last such option is the one that is effective.
4193 specify machine-independent flags.
4194 Most flags have both positive and negative forms; the negative form of
4198 In the table below, only one of the forms is listed---the one you typically will use.
4199 You can figure out the other form by either removing
4203 The following options control specific optimizations.
4204 They are either activated by
4206 options or are related to ones that are.
4207 You can use the following flags in the rare cases when "fine-tuning" of optimizations to be performed is desired.
4210 .It Fl fno-default-inline
4211 Do not make member functions inline by default merely because they are defined inside the class scope (C++ only).
4212 Otherwise, when you specify
4214 member functions defined inside class scope are compiled inline by default; i.e., you don't need to add
4216 in front of the member function name.
4218 .It Fl fno-defer-pop
4219 Always pop the arguments to each function call as soon as that function returns.
4220 For machines which must pop arguments after a function call, the compiler normally lets arguments accumulate on the stack for several function calls and pops them all at once.
4229 Force memory operands to be copied into registers before doing arithmetic on them.
4230 This produces better code by making all memory references potential common subexpressions.
4231 When they are not common subexpressions, instruction combination should eliminate the separate register-load.
4232 This option is now a nop and will be removed in 4.2.
4235 Force memory address constants to be copied into registers before doing arithmetic on them.
4237 .It Fl fomit-frame-pointer
4238 Don't keep the frame pointer in a register for functions that don't need one.
4239 This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions.
4240 .Sy It also makes debugging impossible on some machines.
4242 On some machines, such as the VAX, this flag has no effect, because the standard calling sequence automatically handles the frame pointer and nothing is saved by pretending it doesn't exist.
4243 The machine-description macro
4244 .Va FRAME_POINTER_REQUIRED
4245 controls whether a target machine supports this flag.
4253 .It Fl foptimize-sibling-calls
4254 Optimize sibling and tail recursive calls.
4262 Don't pay attention to the
4265 Normally this option is used to keep the compiler from expanding any functions inline.
4266 Note that if you are not optimizing, no functions can be expanded inline.
4268 .It Fl finline-functions
4269 Integrate all simple functions into their callers.
4270 The compiler heuristically decides which functions are simple enough to be worth integrating in this way.
4272 If all calls to a given function are integrated, and the function is declared
4274 then the function is normally not output as assembler code in its own right.
4279 .It Fl finline-functions-called-once
4282 functions called once for inlining into their caller even if they are not marked
4284 If a call to a given function is integrated, then the function is not output as assembler code in its own right.
4290 .It Fl fearly-inlining
4291 Inline functions marked by
4293 and functions whose body seems smaller than the function call overhead early before doing
4294 .Fl fprofile-generate
4295 instrumentation and real inlining pass.
4296 Doing so makes profiling significantly cheaper and usually inlining faster on programs having large chains of nested wrapper functions.
4300 .It Fl finline-limit= Ns Ar n
4301 By default, GCC limits the size of functions that can be inlined.
4302 This flag allows the control of this limit for functions that are explicitly marked as inline (i.e., marked with the inline keyword or defined within the class definition in c++).
4304 is the size of functions that can be inlined in number of pseudo instructions (not counting parameter handling).
4305 The default value of
4308 Increasing this value can result in more inlined code at the cost of compilation time and memory consumption.
4309 Decreasing usually makes the compilation faster and less code will be inlined (which presumably means slower programs).
4310 This option is particularly useful for programs that use inlining heavily such as those based on recursive templates with C++.
4312 Inlining is actually controlled by a number of parameters, which may be specified individually by using
4313 .Fl -param Ar name Ns = Ns Ar value .
4315 .Fl finline-limit= Ns Ar n
4316 option sets some of these parameters as follows:
4319 .It Sy max-inline-insns-single Ns
4324 .It Sy max-inline-insns-auto Ns
4329 .It Sy min-inline-insns Ns
4332 /4, whichever is smaller.
4334 .It Sy max-inline-insns-rtl Ns
4339 See below for a documentation of the individual parameters controlling inlining.
4342 pseudo instruction represents, in this particular context, an abstract measurement of function's size.
4343 In no way does it represent a count of assembly instructions and as such its exact meaning might change from one release to an another.
4345 .It Fl fkeep-inline-functions
4348 functions that are declared
4350 into the object file, even if the function has been inlined into all of its callers.
4351 This switch does not affect functions using the
4354 In C++, emit any and all inline functions into the object file.
4356 .It Fl fkeep-static-consts
4357 Emit variables declared
4359 when optimization isn't turned on, even if the variables aren't referenced.
4361 GCC enables this option by default.
4362 If you want to force the compiler to check if the variable was referenced, regardless of whether or not optimization is turned on, use the
4363 .Fl fno-keep-static-consts
4366 .It Fl fmerge-constants
4367 Attempt to merge identical constants (string constants and floating point constants) across compilation units.
4369 This option is the default for optimized compilation if the assembler and linker support it.
4371 .Fl fno-merge-constants
4372 to inhibit this behavior.
4380 .It Fl fmerge-all-constants
4381 Attempt to merge identical constants and identical variables.
4384 .Fl fmerge-constants .
4386 .Fl fmerge-constants
4387 this considers e.g. even constant initialized arrays or initialized constant variables with integral or floating point types.
4388 Languages like C or C++ require each non-automatic variable to have distinct location, so using this option will result in non-conforming behavior.
4390 .It Fl fmodulo-sched
4391 Perform swing modulo scheduling immediately before the first scheduling pass.
4392 This pass looks at innermost loops and reorders their instructions by overlapping different iterations.
4394 .It Fl fno-branch-count-reg
4395 Do not use "decrement and branch" instructions on a count register, but instead generate a sequence of instructions that decrement a register, compare it against zero, then branch based upon the result.
4396 This option is only meaningful on architectures that support such instructions, which include x86, PowerPC, IA-64 and S/390.
4399 .Fl fbranch-count-reg ,
4401 .Fl fstrength-reduce
4404 .It Fl fno-function-cse
4405 Do not put function addresses in registers; make each instruction that calls a constant function contain the function's address explicitly.
4407 This option results in less efficient code, but some strange hacks that alter the assembler output may be confused by the optimizations performed when this option is not used.
4412 .It Fl fno-zero-initialized-in-bss
4413 If the target supports a BSS section, GCC by default puts variables that are initialized to zero into BSS.
4414 This can save space in the resulting code.
4416 This option turns off this behavior because some programs explicitly rely on variables going to the data section.
4417 E.g., so that the resulting executable can find the beginning of that section and/or make assumptions based on that.
4420 .Fl fzero-initialized-in-bss .
4422 .It Fl fmudflap Fl fmudflapth Fl fmudflapir
4423 For front-ends that support it (C and C++), instrument all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with range/validity tests.
4424 Modules so instrumented should be immune to buffer overflows, invalid heap use, and some other classes of C/C++ programming errors.
4425 The instrumentation relies on a separate runtime library
4426 .Pa ( libmudflap ) ,
4427 which will be linked into a program if
4429 is given at link time.
4430 Run-time behavior of the instrumented program is controlled by the
4432 environment variable.
4434 .Va env MUDFLAP_OPTIONS=-help a.out
4441 to compile and to link if your program is multi-threaded.
4448 if instrumentation should ignore pointer reads.
4449 This produces less instrumentation (and therefore faster execution) and still provides some protection against outright memory corrupting writes, but allows erroneously read data to propagate within a program.
4451 .It Fl fstrength-reduce
4452 Perform the optimizations of loop strength reduction and elimination of iteration variables.
4459 .It Fl fthread-jumps
4460 Perform optimizations where we check to see if a jump branches to a location where another comparison subsumed by the first is found.
4461 If so, the first branch is redirected to either the destination of the second branch or a point immediately following it, depending on whether the condition is known to be true or false.
4468 .It Fl fcse-follow-jumps
4469 In common subexpression elimination, scan through jump instructions when the target of the jump is not reached by any other path.
4470 For example, when CSE encounters an
4474 clause, CSE will follow the jump when the condition tested is false.
4481 .It Fl fcse-skip-blocks
4483 .Fl fcse-follow-jumps ,
4484 but causes CSE to follow jumps which conditionally skip over blocks.
4485 When CSE encounters a simple
4487 statement with no else clause,
4488 .Fl fcse-skip-blocks
4489 causes CSE to follow the jump around the body of the
4497 .It Fl frerun-cse-after-loop
4498 Re-run common subexpression elimination after loop optimizations has been performed.
4505 .It Fl frerun-loop-opt
4506 Run the loop optimizer twice.
4514 Perform a global common subexpression elimination pass.
4515 This pass also performs global constant and copy propagation.
4518 When compiling a program using computed gotos, a GCC extension, you may get better runtime performance if you disable the global common subexpression elimination pass by adding
4520 to the command line.
4530 is enabled, global common subexpression elimination will attempt to move loads which are only killed by stores into themselves.
4531 This allows a loop containing a load/store sequence to be changed to a load outside the loop, and a copy/store within the loop.
4533 Enabled by default when gcse is enabled.
4538 is enabled, a store motion pass is run after global common subexpression elimination.
4539 This pass will attempt to move stores out of loops.
4540 When used in conjunction with
4542 loops containing a load/store sequence can be changed to a load before the loop and a store after the loop.
4544 Not enabled at any optimization level.
4549 is enabled, the global common subexpression elimination pass eliminates redundant loads that come after stores to the same memory location (both partial and full redundancies).
4551 Not enabled at any optimization level.
4553 .It Fl fgcse-after-reload
4555 .Fl fgcse-after-reload
4556 is enabled, a redundant load elimination pass is performed after reload.
4557 The purpose of this pass is to cleanup redundant spilling.
4559 .It Fl floop-optimize
4560 Perform loop optimizations: move constant expressions out of loops, simplify exit test conditions and optionally do strength-reduction as well.
4568 .It Fl floop-optimize2
4569 Perform loop optimizations using the new loop optimizer.
4570 The optimizations (loop unrolling, peeling and unswitching, loop invariant motion) are enabled by separate flags.
4572 .It Fl funsafe-loop-optimizations
4573 If given, the loop optimizer will assume that loop indices do not overflow, and that the loops with nontrivial exit condition are not infinite.
4574 This enables a wider range of loop optimizations even if the loop optimizer itself cannot prove that these assumptions are valid.
4576 .Fl Wunsafe-loop-optimizations ,
4577 the compiler will warn you if it finds this kind of loop.
4579 .It Fl fcrossjumping
4580 Perform cross-jumping transformation.
4581 This transformation unifies equivalent code and save code size.
4582 The resulting code may or may not perform better than without cross-jumping.
4589 .It Fl fif-conversion
4590 Attempt to transform conditional jumps into branch-less equivalents.
4591 This include use of conditional moves, min, max, set flags and abs instructions, and some tricks doable by standard arithmetics.
4592 The use of conditional execution on chips where it is available is controlled by
4593 .Va if-conversion2 .
4601 .It Fl fif-conversion2
4602 Use conditional execution (where available) to transform conditional jumps into branch-less equivalents.
4610 .It Fl fdelete-null-pointer-checks
4611 Use global dataflow analysis to identify and eliminate useless checks for null pointers.
4612 The compiler assumes that dereferencing a null pointer would have halted the program.
4613 If a pointer is checked after it has already been dereferenced, it cannot be null.
4615 In some environments, this assumption is not true, and programs can safely dereference null pointers.
4617 .Fl fno-delete-null-pointer-checks
4618 to disable this optimization for programs which depend on that behavior.
4625 .It Fl fexpensive-optimizations
4626 Perform a number of minor optimizations that are relatively expensive.
4633 .It Fl foptimize-register-move
4635 Attempt to reassign register numbers in move instructions and as operands of other simple instructions in order to maximize the amount of register tying.
4636 This is especially helpful on machines with two-operand instructions.
4641 .Fl foptimize-register-move
4642 are the same optimization.
4649 .It Fl fdelayed-branch
4650 If supported for the target machine, attempt to reorder instructions to exploit instruction slots available after delayed branch instructions.
4658 .It Fl fschedule-insns
4659 If supported for the target machine, attempt to reorder instructions to eliminate execution stalls due to required data being unavailable.
4660 This helps machines that have slow floating point or memory load instructions by allowing other instructions to be issued until the result of the load or floating point instruction is required.
4667 .It Fl fschedule-insns2
4669 .Fl fschedule-insns ,
4670 but requests an additional pass of instruction scheduling after register allocation has been done.
4671 This is especially useful on machines with a relatively small number of registers and where memory load instructions take more than one cycle.
4678 .It Fl fno-sched-interblock
4679 Don't schedule instructions across basic blocks.
4680 This is normally enabled by default when scheduling before register allocation, i.e.
4687 .It Fl fno-sched-spec
4688 Don't allow speculative motion of non-load instructions.
4689 This is normally enabled by default when scheduling before register allocation, i.e.
4696 .It Fl fsched-spec-load
4697 Allow speculative motion of some load instructions.
4698 This only makes sense when scheduling before register allocation, i.e. with
4704 .It Fl fsched-spec-load-dangerous
4705 Allow speculative motion of more load instructions.
4706 This only makes sense when scheduling before register allocation, i.e. with
4712 .It Fl fsched-stalled-insns
4713 .It Fl fsched-stalled-insns= Ns Ar n
4714 Define how many insns (if any) can be moved prematurely from the queue of stalled insns into the ready list, during the second scheduling pass.
4715 .Fl fno-fsched-stalled-insns
4717 .Fl fsched-stalled-insns=0
4718 are equivalent and mean that no insns will be moved prematurely.
4721 is unspecified then there is no limit on how many queued insns can be moved prematurely.
4723 .It Fl fsched-stalled-insns-dep
4724 .It Fl fsched-stalled-insns-dep= Ns Ar n
4725 Define how many insn groups (cycles) will be examined for a dependency on a stalled insn that is candidate for premature removal from the queue of stalled insns.
4726 This has an effect only during the second scheduling pass, and only if
4727 .Fl fsched-stalled-insns
4728 is used and its value is not zero.
4730 .Fl fno-sched-stalled-insns-dep
4732 .Fl fsched-stalled-insns-dep=0 .
4734 .Fl fsched-stalled-insns-dep
4735 without a value is equivalent to +
4736 .Fl fsched-stalled-insns-dep=1 .
4738 .It Fl fsched2-use-superblocks
4739 When scheduling after register allocation, do use superblock scheduling algorithm.
4740 Superblock scheduling allows motion across basic block boundaries resulting on faster schedules.
4741 This option is experimental, as not all machine descriptions used by GCC model the CPU closely enough to avoid unreliable results from the algorithm.
4743 This only makes sense when scheduling after register allocation, i.e. with
4744 .Fl fschedule-insns2
4749 .It Fl fsched2-use-traces
4751 .Fl fsched2-use-superblocks
4752 algorithm when scheduling after register allocation and additionally perform code duplication in order to increase the size of superblocks using tracer pass.
4755 for details on trace formation.
4757 This mode should produce faster but significantly longer programs.
4759 .Fl fbranch-probabilities
4760 the traces constructed may not match the reality and hurt the performance.
4761 This only makes sense when scheduling after register allocation, i.e. with
4762 .Fl fschedule-insns2
4767 .It Fl freschedule-modulo-scheduled-loops
4768 The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled we may want to prevent the later scheduling passes from changing its schedule, we use this option to control that.
4770 .It Fl fcaller-saves
4771 Enable values to be allocated in registers that will be clobbered by function calls, by emitting extra instructions to save and restore the registers around such calls.
4772 Such allocation is done only when it seems to result in better code than would otherwise be produced.
4774 This option is always enabled by default on certain machines, usually those which have no call-preserved registers to use instead.
4782 Perform Partial Redundancy Elimination (PRE) on trees.
4783 This flag is enabled by default at
4789 Perform Full Redundancy Elimination (FRE) on trees.
4790 The difference between FRE and PRE is that FRE only considers expressions that are computed on all paths leading to the redundant computation.
4791 This analysis faster than PRE, though it exposes fewer redundancies.
4792 This flag is enabled by default at
4796 .It Fl ftree-copy-prop
4797 Perform copy propagation on trees.
4798 This pass eliminates unnecessary copy operations.
4799 This flag is enabled by default at
4803 .It Fl ftree-store-copy-prop
4804 Perform copy propagation of memory loads and stores.
4805 This pass eliminates unnecessary copy operations in memory references (structures, global variables, arrays, etc).
4806 This flag is enabled by default at
4811 Perform structural alias analysis on trees.
4812 This flag is enabled by default at
4817 Perform forward store motion on trees.
4818 This flag is enabled by default at
4823 Perform sparse conditional constant propagation (CCP) on trees.
4824 This pass only operates on local scalar variables and is enabled by default at
4828 .It Fl ftree-store-ccp
4829 Perform sparse conditional constant propagation (CCP) on trees.
4830 This pass operates on both local scalar variables and memory stores and loads (global variables, structures, arrays, etc).
4831 This flag is enabled by default at
4836 Perform dead code elimination (DCE) on trees.
4837 This flag is enabled by default at
4841 .It Fl ftree-dominator-opts
4842 Perform a variety of simple scalar cleanups (constant/copy propagation, redundancy elimination, range propagation and expression simplification) based on a dominator tree traversal.
4843 This also performs jump threading (to reduce jumps to jumps).
4844 This flag is enabled by default at
4849 Perform loop header copying on trees.
4850 This is beneficial since it increases effectiveness of code motion optimizations.
4851 It also saves one jump.
4852 This flag is enabled by default at
4855 It is not enabled for
4857 since it usually increases code size.
4859 .It Fl ftree-loop-optimize
4860 Perform loop optimizations on trees.
4861 This flag is enabled by default at
4865 .It Fl ftree-loop-linear
4866 Perform linear loop transformations on tree.
4867 This flag can improve cache performance and allow further loop optimizations to take place.
4869 .It Fl ftree-loop-im
4870 Perform loop invariant motion on trees.
4871 This pass moves only invariants that would be hard to handle at RTL level (function calls, operations that expand to nontrivial sequences of insns).
4874 it also moves operands of conditions that are invariant out of the loop, so that we can use just trivial invariantness analysis in loop unswitching.
4875 The pass also includes store motion.
4877 .It Fl ftree-loop-ivcanon
4878 Create a canonical counter for number of iterations in the loop for that determining number of iterations requires complicated analysis.
4879 Later optimizations then may determine the number easily.
4880 Useful especially in connection with unrolling.
4883 Perform induction variable optimizations (strength reduction, induction variable merging and induction variable elimination) on trees.
4886 Perform scalar replacement of aggregates.
4887 This pass replaces structure references with scalars to prevent committing structures to memory too early.
4888 This flag is enabled by default at
4892 .It Fl ftree-copyrename
4893 Perform copy renaming on trees.
4894 This pass attempts to rename compiler temporaries to other variables at copy locations, usually resulting in variable names which more closely resemble the original variables.
4895 This flag is enabled by default at
4900 Perform temporary expression replacement during the SSA-\*[Gt]normal phase.
4901 Single use/single def temporaries are replaced at their use location with their defining expression.
4902 This results in non-GIMPLE code, but gives the expanders much more complex trees to work on resulting in better RTL generation.
4903 This is enabled by default at
4908 Perform live range splitting during the SSA-\*[Gt]normal phase.
4909 Distinct live ranges of a variable are split into unique variables, allowing for better optimization later.
4910 This is enabled by default at
4914 .It Fl ftree-vectorize
4915 Perform loop vectorization on trees.
4917 .It Fl ftree-vect-loop-version
4918 Perform loop versioning when doing loop vectorization on trees.
4919 When a loop appears to be vectorizable except that data alignment or data dependence cannot be determined at compile time then vectorized and non-vectorized versions of the loop are generated along with runtime checks for alignment or dependence to control which version is executed.
4920 This option is enabled by default except at level
4922 where it is disabled.
4925 Perform Value Range Propagation on trees.
4926 This is similar to the constant propagation pass, but instead of values, ranges of values are propagated.
4927 This allows the optimizers to remove unnecessary range checks like array bound checks and null pointer checks.
4928 This is enabled by default at
4931 Null pointer check elimination is only done if
4932 .Fl fdelete-null-pointer-checks
4936 Perform tail duplication to enlarge superblock size.
4937 This transformation simplifies the control flow of the function allowing other optimizations to do better job.
4939 .It Fl funroll-loops
4940 Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop.
4943 .Fl fstrength-reduce
4945 .Fl frerun-cse-after-loop .
4946 This option makes code larger, and may or may not make it run faster.
4948 .It Fl funroll-all-loops
4949 Unroll all loops, even if their number of iterations is uncertain when the loop is entered.
4950 This usually makes programs run more slowly.
4951 .Fl funroll-all-loops
4952 implies the same options as
4955 .It Fl fsplit-ivs-in-unroller
4956 Enables expressing of values of induction variables in later iterations of the unrolled loop using the value in the first iteration.
4957 This breaks long dependency chains, thus improving efficiency of the scheduling passes.
4961 and CSE is often sufficient to obtain the same effect.
4962 However in cases the loop body is more complicated than a single basic block, this is not reliable.
4963 It also does not work at all on some of the architectures due to restrictions in the CSE pass.
4965 This optimization is enabled by default.
4967 .It Fl fvariable-expansion-in-unroller
4968 With this option, the compiler will create multiple copies of some local variables when unrolling a loop which can result in superior code.
4970 .It Fl fprefetch-loop-arrays
4971 If supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that access large arrays.
4973 These options may generate better or worse code; results are highly dependent on the structure of loops within the source code.
4976 .It Fl fno-peephole2
4977 Disable any machine-specific peephole optimizations.
4978 The difference between
4982 is in how they are implemented in the compiler; some targets use one, some use the other, a few use both.
4985 is enabled by default.
4992 .It Fl fno-guess-branch-probability
4993 Do not guess branch probabilities using heuristics.
4995 GCC will use heuristics to guess branch probabilities if they are not provided by profiling feedback
4996 .Fl ( fprofile-arcs ) .
4997 These heuristics are based on the control flow graph.
4998 If some branch probabilities are specified by
4999 .Sy __builtin_expect ,
5000 then the heuristics will be used to guess branch probabilities for the rest of the control flow graph, taking the
5001 .Sy __builtin_expect
5003 The interactions between the heuristics and
5004 .Sy __builtin_expect
5005 can be complex, and in some cases, it may be useful to disable the heuristics so that the effects of
5006 .Sy __builtin_expect
5007 are easier to understand.
5010 .Fl fguess-branch-probability
5017 .It Fl freorder-blocks
5018 Reorder basic blocks in the compiled function in order to reduce number of taken branches and improve code locality.
5024 .It Fl freorder-blocks-and-partition
5025 In addition to reordering basic blocks in the compiled function, in order to reduce number of taken branches, partitions hot and cold basic blocks into separate sections of the assembly and .o files, to improve paging and cache locality performance.
5027 This optimization is automatically turned off in the presence of exception handling, for linkonce sections, for functions with a user-defined section attribute and on any architecture that does not support named sections.
5029 .It Fl freorder-functions
5030 Reorder functions in the object file in order to improve code locality.
5031 This is implemented by using special subsections
5033 for most frequently executed functions and
5035 for unlikely executed functions.
5036 Reordering is done by the linker so object file format must support named sections and linker must place them in a reasonable way.
5038 Also profile feedback must be available in to make this option effective.
5048 .It Fl fstrict-aliasing
5049 Allows the compiler to assume the strictest aliasing rules applicable to the language being compiled.
5050 For C (and C++), this activates optimizations based on the type of expressions.
5051 In particular, an object of one type is assumed never to reside at the same address as an object of a different type, unless the types are almost the same.
5060 A character type may alias any other type.
5062 Pay special attention to code like this:
5064 .Bd -literal -offset indent
5076 The practice of reading from a different union member than the one most recently written to (called "type-punning") is common.
5078 .Fl fstrict-aliasing ,
5079 type-punning is allowed, provided the memory is accessed through the union type.
5080 So, the code above will work as expected.
5081 However, this code might not:
5083 .Bd -literal -offset indent
5092 Every language that wishes to perform language-specific alias analysis should define a function that computes, given an
5094 node, an alias set for the node.
5095 Nodes in different alias sets are not allowed to alias.
5096 For an example, see the C front-end function
5097 .Va c_get_alias_set .
5104 .It Fl falign-functions
5105 .It Fl falign-functions= Ns Ar n
5106 Align the start of functions to the next power-of-two greater than
5112 .Fl falign-functions=32
5113 aligns functions to the next 32-byte boundary, but
5114 .Fl falign-functions=24
5115 would align to the next 32-byte boundary only if this can be done by skipping 23 bytes or less.
5117 .Fl fno-align-functions
5119 .Fl falign-functions=1
5120 are equivalent and mean that functions will not be aligned.
5122 Some assemblers only support this flag when
5124 is a power of two; in that case, it is rounded up.
5128 is not specified or is zero, use a machine-dependent default.
5134 .It Fl falign-labels
5135 .It Fl falign-labels= Ns Ar n
5136 Align all branch targets to a power-of-two boundary, skipping up to
5139 .Fl falign-functions .
5140 This option can easily make code slower, because it must insert dummy operations for when the branch target is reached in the usual flow of the code.
5142 .Fl fno-align-labels
5145 are equivalent and mean that labels will not be aligned.
5151 are applicable and are greater than this value, then their values are used instead.
5155 is not specified or is zero, use a machine-dependent default which is very likely to be
5157 meaning no alignment.
5164 .It Fl falign-loops= Ns Ar n
5165 Align loops to a power-of-two boundary, skipping up to
5168 .Fl falign-functions .
5169 The hope is that the loop will be executed many times, which will make up for any execution of the dummy operations.
5174 are equivalent and mean that loops will not be aligned.
5178 is not specified or is zero, use a machine-dependent default.
5185 .It Fl falign-jumps= Ns Ar n
5186 Align branch targets to a power-of-two boundary, for branch targets where the targets can only be reached by jumping, skipping up to
5189 .Fl falign-functions .
5190 In this case, no dummy operations need be executed.
5195 are equivalent and mean that loops will not be aligned.
5199 is not specified or is zero, use a machine-dependent default.
5205 .It Fl funit-at-a-time
5206 Parse the whole compilation unit before starting to produce code.
5207 This allows some extra optimizations to take place but consumes more memory (in general).
5208 There are some compatibility issues with
5216 mode may change the order in which functions, variables, and top-level
5218 statements are emitted, and will likely break code relying on some particular ordering.
5219 The majority of such top-level
5221 statements, though, can be replaced by
5227 mode removes unreferenced static variables and functions.
5228 This may result in undefined references when an
5230 statement refers directly to variables or functions that are otherwise unused.
5231 In that case either the variable/function shall be listed as an operand of the
5233 statement operand or, in the case of top-level
5235 statements the attribute
5237 shall be used on the declaration.
5240 Static functions now can use non-standard passing conventions that may break
5242 statements calling functions directly.
5245 will prevent this behavior.
5248 As a temporary workaround,
5249 .Fl fno-unit-at-a-time
5250 can be used, but this scheme may not be supported by future releases of GCC.
5259 Constructs webs as commonly used for register allocation purposes and assign each web individual pseudo register.
5260 This allows the register allocation pass to operate on pseudos directly, but also strengthens several other optimization passes, such as CSE, loop optimizer and trivial dead code remover.
5261 It can, however, make debugging impossible, since variables will no longer stay in a "home register".
5263 Enabled by default with
5266 .It Fl fwhole-program
5267 Assume that the current compilation unit represents whole program being compiled.
5268 All public functions and variables with the exception of
5270 and those merged by attribute
5271 .Va externally_visible
5272 become static functions and in a affect gets more aggressively optimized by interprocedural optimizers.
5273 While this option is equivalent to proper use of
5275 keyword for programs consisting of single file, in combination with option
5277 this flag can be used to compile most of smaller scale C programs since the functions and variables become local for the whole combined compilation unit, not for the single source file itself.
5279 .It Fl fcprop-registers
5280 After register allocation and post-register allocation instruction splitting, we perform a copy-propagation pass to try to reduce scheduling dependencies and occasionally eliminate the copy.
5288 .It Fl fprofile-generate
5289 Enable options usually used for instrumenting application to produce profile useful for later recompilation with profile feedback based optimization.
5291 .Fl fprofile-generate
5292 both when compiling and when linking your program.
5294 The following options are enabled:
5295 .Va -fprofile-arcs ,
5296 .Va -fprofile-values ,
5300 Enable profile feedback directed optimizations, and optimizations generally profitable only with profile feedback available.
5302 The following options are enabled:
5303 .Va -fbranch-probabilities ,
5305 .Va -funroll-loops ,
5308 .Va -fno-loop-optimize .
5311 The following options control compiler behavior regarding floating point arithmetic.
5312 These options trade off between speed and correctness.
5313 All must be specifically enabled.
5317 Do not store floating point variables in registers, and inhibit other options that might change whether a floating point value is taken from a register or memory.
5319 This option prevents undesirable excess precision on machines such as the 68000 where the floating registers (of the 68881) keep more precision than a
5321 is supposed to have.
5322 Similarly for the x86 architecture.
5323 For most programs, the excess precision does only good, but a few programs rely on the precise definition of IEEE floating point.
5326 for such programs, after modifying them to store all pertinent intermediate computations into variables.
5330 .Fl fno-math-errno ,
5331 .Fl funsafe-math-optimizations ,
5332 .Fl fno-trapping-math ,
5333 .Fl ffinite-math-only ,
5334 .Fl fno-rounding-math ,
5335 .Fl fno-signaling-nans
5337 .Sy fcx-limited-range .
5339 This option causes the preprocessor macro
5343 This option should never be turned on by any
5345 option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions.
5347 .It Fl fno-math-errno
5348 Do not set ERRNO after calling math functions that are executed with a single instruction, e.g., sqrt.
5349 A program that relies on IEEE exceptions for math error handling may want to use this flag for speed while maintaining IEEE arithmetic compatibility.
5351 This option should never be turned on by any
5353 option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions.
5358 On Darwin systems, the math library never sets
5360 There is therefore no reason for the compiler to consider the possibility that it might, and
5364 .It Fl funsafe-math-optimizations
5365 Allow optimizations for floating-point arithmetic that (a) assume that arguments and results are valid and (b) may violate IEEE or ANSI standards.
5366 When used at link-time, it may include libraries or startup files that change the default FPU control word or other similar optimizations.
5368 This option should never be turned on by any
5370 option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions.
5373 .Fl fno-unsafe-math-optimizations .
5375 .It Fl ffinite-math-only
5376 Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs.
5378 This option should never be turned on by any
5380 option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications.
5383 .Fl fno-finite-math-only .
5385 .It Fl fno-trapping-math
5386 Compile code assuming that floating-point operations cannot generate user-visible traps.
5387 These traps include division by zero, overflow, underflow, inexact result and invalid operation.
5389 .Fl fno-signaling-nans .
5390 Setting this option may allow faster code if one relies on "non-stop" IEEE arithmetic, for example.
5392 This option should never be turned on by any
5394 option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions.
5397 .Fl ftrapping-math .
5399 .It Fl frounding-math
5400 Disable transformations and optimizations that assume default floating point rounding behavior.
5401 This is round-to-zero for all floating point to integer conversions, and round-to-nearest for all other arithmetic truncations.
5402 This option should be specified for programs that change the FP rounding mode dynamically, or that may be executed with a non-default rounding mode.
5403 This option disables constant folding of floating point expressions at compile-time (which may be affected by rounding mode) and arithmetic transformations that are unsafe in the presence of sign-dependent rounding modes.
5406 .Fl fno-rounding-math .
5408 This option is experimental and does not currently guarantee to disable all GCC optimizations that are affected by rounding mode.
5409 Future versions of GCC may provide finer control of this setting using C99's
5412 This command line option will be used to specify the default state for
5415 .It Fl fsignaling-nans
5416 Compile code assuming that IEEE signaling NaNs may generate user-visible traps during floating-point operations.
5417 Setting this option disables optimizations that may change the number of exceptions visible with signaling NaNs.
5419 .Fl ftrapping-math .
5421 This option causes the preprocessor macro
5422 .Va __SUPPORT_SNAN__
5426 .Fl fno-signaling-nans .
5428 This option is experimental and does not currently guarantee to disable all GCC optimizations that affect signaling NaN behavior.
5430 .It Fl fsingle-precision-constant
5431 Treat floating point constant as single precision constant instead of implicitly converting it to double precision constant.
5433 .It Fl fcx-limited-range
5434 When enabled, this option states that a range reduction step is not needed when performing complex division.
5436 .Fl fno-cx-limited-range ,
5440 This option controls the default setting of the ISO C99
5441 .Va CX_LIMITED_RANGE
5443 Nevertheless, the option applies to all languages.
5446 The following options control optimizations that may improve performance, but are not enabled by any
5449 This section includes experimental options that may produce broken code.
5452 .It Fl fbranch-probabilities
5453 After running a program compiled with
5455 you can compile it a second time using
5456 .Fl fbranch-probabilities ,
5457 to improve optimizations based on the number of times each branch was taken.
5458 When the program compiled with
5460 exits it saves arc execution counts to a file called
5462 for each source file The information in this data file is very dependent on the structure of the generated code, so you must use the same source code and the same optimization options for both compilations.
5465 .Fl fbranch-probabilities ,
5472 These can be used to improve optimization.
5473 Currently, they are only used in one place: in
5475 instead of guessing which path a branch is mostly to take, the
5477 values are used to exactly determine which path is taken more often.
5479 .It Fl fprofile-values
5482 it adds code so that some data about values of expressions in the program is gathered.
5485 .Fl fbranch-probabilities ,
5486 it reads back the data gathered from profiling values of expressions and adds
5487 .Sy REG_VALUE_PROFILE
5488 notes to instructions for their later usage in optimizations.
5491 .Fl fprofile-generate
5498 it instructs the compiler to add a code to gather information about values of expressions.
5501 .Fl fbranch-probabilities ,
5502 it reads back the data gathered and actually performs the optimizations based on them.
5503 Currently the optimizations include specialization of division operation using the knowledge about the value of the denominator.
5505 .It Fl frename-registers
5506 Attempt to avoid false dependencies in scheduled code by making use of registers left over after register allocation.
5507 This optimization will most benefit processors with lots of registers.
5508 Depending on the debug information format adopted by the target, however, it can make debugging impossible, since variables will no longer stay in a "home register".
5510 Enabled by default with
5514 Perform tail duplication to enlarge superblock size.
5515 This transformation simplifies the control flow of the function allowing other optimizations to do better job.
5520 .It Fl funroll-loops
5521 Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop.
5524 .Fl frerun-cse-after-loop ,
5527 .Fl frename-registers .
5528 It also turns on complete loop peeling (i.e. complete removal of loops with small constant number of iterations).
5529 This option makes code larger, and may or may not make it run faster.
5534 .It Fl funroll-all-loops
5535 Unroll all loops, even if their number of iterations is uncertain when the loop is entered.
5536 This usually makes programs run more slowly.
5537 .Fl funroll-all-loops
5538 implies the same options as
5542 Peels the loops for that there is enough information that they do not roll much (from profile feedback).
5543 It also turns on complete loop peeling (i.e. complete removal of loops with small constant number of iterations).
5548 .It Fl fmove-loop-invariants
5549 Enables the loop invariant motion pass in the new loop optimizer.
5553 .It Fl funswitch-loops
5554 Move branches with loop invariant conditions out of the loop, with duplicates of the loop on both branches (modified according to result of the condition).
5556 .It Fl fprefetch-loop-arrays
5557 If supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that access large arrays.
5562 .It Fl ffunction-sections
5563 .It Fl fdata-sections
5564 Place each function or data item into its own section in the output file if the target supports arbitrary sections.
5565 The name of the function or the name of the data item determines the section's name in the output file.
5567 Use these options on systems where the linker can perform optimizations to improve locality of reference in the instruction space.
5568 Most systems using the ELF object format and SPARC processors running Solaris 2 have linkers with such optimizations.
5569 AIX may have these optimizations in the future.
5571 Only use these options when there are significant benefits from doing so.
5572 When you specify these options, the assembler and linker will create larger object and executable files and will also be slower.
5573 You will not be able to use
5575 on all systems if you specify this option and you may have problems with debugging if you specify both this option and
5578 .It Fl fbranch-target-load-optimize
5579 Perform branch target register load optimization before prologue / epilogue threading.
5580 The use of target registers can typically be exposed only during reload, thus hoisting loads out of loops and doing inter-block scheduling needs a separate optimization pass.
5582 .It Fl fbranch-target-load-optimize2
5583 Perform branch target register load optimization after prologue / epilogue threading.
5585 .It Fl fbtr-bb-exclusive
5586 When performing branch target register load optimization, don't reuse branch target registers in within any basic block.
5588 .It Fl fstack-protector
5589 Emit extra code to check for buffer overflows, such as stack smashing attacks.
5590 This is done by adding a guard variable to functions with vulnerable objects.
5591 This includes functions that call alloca, and functions with buffers larger than 8 bytes.
5592 The guards are initialized when a function is entered and then checked when the function exits.
5593 If a guard check fails, an error message is printed and the program exits.
5595 .It Fl fstack-protector-all
5597 .Fl fstack-protector
5598 except that all functions are protected.
5600 .It Fl -param Ar name Ns = Ns Ar value
5601 In some places, GCC uses various constants to control the amount of optimization that is done.
5602 For example, GCC will not inline functions that contain more that a certain number of instructions.
5603 You can control some of these constants on the command-line using the
5607 The names of specific parameters, and the meaning of the values, are tied to the internals of the compiler, and are subject to change without notice in future releases.
5612 The allowable choices for
5614 are given in the following table:
5617 .It Sy salias-max-implicit-fields Ns
5618 The maximum number of fields in a variable without direct structure accesses for which structure aliasing will consider trying to track each field.
5621 .It Sy sra-max-structure-size Ns
5622 The maximum structure size, in bytes, at which the scalar replacement of aggregates (SRA) optimization will perform block copies.
5623 The default value, 0, implies that GCC will select the most appropriate size itself.
5625 .It Sy sra-field-structure-ratio Ns
5626 The threshold ratio (as a percentage) between instantiated fields and the complete structure size.
5627 We say that if the ratio of the number of bytes in instantiated fields to the number of bytes in the complete structure exceeds this parameter, then block copies are not used.
5630 .It Sy max-crossjump-edges Ns
5631 The maximum number of incoming edges to consider for crossjumping.
5632 The algorithm used by
5634 is O(N^2) in the number of edges incoming to each block.
5635 Increasing values mean more aggressive optimization, making the compile time increase with probably small improvement in executable size.
5637 .It Sy min-crossjump-insns Ns
5638 The minimum number of instructions which must be matched at the end of two blocks before crossjumping will be performed on them.
5639 This value is ignored in the case where all instructions in the block being crossjumped from are matched.
5640 The default value is 5.
5642 .It Sy max-grow-copy-bb-insns Ns
5643 The maximum code size expansion factor when copying basic blocks instead of jumping.
5644 The expansion is relative to a jump instruction.
5645 The default value is 8.
5647 .It Sy max-goto-duplication-insns Ns
5648 The maximum number of instructions to duplicate to a block that jumps to a computed goto.
5649 To avoid O(N^2) behavior in a number of passes, GCC factors computed gotos early in the compilation process, and unfactors them as late as possible.
5650 Only computed jumps at the end of a basic blocks with no more than max-goto-duplication-insns are unfactored.
5651 The default value is 8.
5653 .It Sy max-delay-slot-insn-search Ns
5654 The maximum number of instructions to consider when looking for an instruction to fill a delay slot.
5655 If more than this arbitrary number of instructions is searched, the time savings from filling the delay slot will be minimal so stop searching.
5656 Increasing values mean more aggressive optimization, making the compile time increase with probably small improvement in executable run time.
5658 .It Sy max-delay-slot-live-search Ns
5659 When trying to fill delay slots, the maximum number of instructions to consider when searching for a block with valid live register information.
5660 Increasing this arbitrarily chosen value means more aggressive optimization, increasing the compile time.
5661 This parameter should be removed when the delay slot code is rewritten to maintain the control-flow graph.
5663 .It Sy max-gcse-memory Ns
5664 The approximate maximum amount of memory that will be allocated in order to perform the global common subexpression elimination optimization.
5665 If more memory than specified is required, the optimization will not be done.
5667 .It Sy max-gcse-passes Ns
5668 The maximum number of passes of GCSE to run.
5671 .It Sy max-pending-list-length Ns
5672 The maximum number of pending dependencies scheduling will allow before flushing the current state and starting over.
5673 Large functions with few branches or calls can create excessively large lists which needlessly consume memory and resources.
5675 .It Sy max-inline-insns-single Ns
5676 Several parameters control the tree inliner used in gcc.
5677 This number sets the maximum number of instructions (counted in GCC's internal representation) in a single function that the tree inliner will consider for inlining.
5678 This only affects functions declared inline and methods implemented in a class declaration (C++).
5679 The default value is 450.
5681 .It Sy max-inline-insns-auto Ns
5683 .Fl finline-functions
5686 a lot of functions that would otherwise not be considered for inlining by the compiler will be investigated.
5687 To those functions, a different (more restrictive) limit compared to functions declared inline can be applied.
5688 The default value is 90.
5690 .It Sy large-function-insns Ns
5691 The limit specifying really large functions.
5692 For functions larger than this limit after inlining inlining is constrained by
5693 .Fl -param Ar large-function-growth .
5694 This parameter is useful primarily to avoid extreme compilation time caused by non-linear algorithms used by the backend.
5695 This parameter is ignored when
5698 The default value is 2700.
5700 .It Sy large-function-growth Ns
5701 Specifies maximal growth of large function caused by inlining in percents.
5702 This parameter is ignored when
5705 The default value is 100 which limits large function growth to 2.0 times the original size.
5707 .It Sy large-unit-insns Ns
5708 The limit specifying large translation unit.
5709 Growth caused by inlining of units larger than this limit is limited by
5710 .Fl -param Ar inline-unit-growth .
5711 For small units this might be too tight (consider unit consisting of function A that is inline and B that just calls A three time.
5712 If B is small relative to A, the growth of unit is 300\e% and yet such inlining is very sane.
5713 For very large units consisting of small inlininable functions however the overall unit growth limit is needed to avoid exponential explosion of code size.
5714 Thus for smaller units, the size is increased to
5715 .Fl -param Ar large-unit-insns
5717 .Fl -param Ar inline-unit-growth .
5718 The default is 10000
5720 .It Sy inline-unit-growth Ns
5721 Specifies maximal overall growth of the compilation unit caused by inlining.
5722 This parameter is ignored when
5725 The default value is 50 which limits unit growth to 1.5 times the original size.
5727 .It Sy max-inline-insns-recursive Ns
5728 .It Sy max-inline-insns-recursive-auto Ns
5729 Specifies maximum number of instructions out-of-line copy of self recursive inline function can grow into by performing recursive inlining.
5731 For functions declared inline
5732 .Fl -param Ar max-inline-insns-recursive
5733 is taken into account.
5734 For function not declared inline, recursive inlining happens only when
5735 .Fl finline-functions
5739 .Fl -param Ar max-inline-insns-recursive-auto
5741 The default value is 450.
5743 .It Sy max-inline-recursive-depth Ns
5744 .It Sy max-inline-recursive-depth-auto Ns
5745 Specifies maximum recursion depth used by the recursive inlining.
5747 For functions declared inline
5748 .Fl -param Ar max-inline-recursive-depth
5749 is taken into account.
5750 For function not declared inline, recursive inlining happens only when
5751 .Fl finline-functions
5755 .Fl -param Ar max-inline-recursive-depth-auto
5757 The default value is 450.
5759 .It Sy min-inline-recursive-probability Ns
5760 Recursive inlining is profitable only for function having deep recursion in average and can hurt for function having little recursion depth by increasing the prologue size or complexity of function body to other optimizers.
5762 When profile feedback is available (see
5763 .Fl fprofile-generate )
5764 the actual recursion depth can be guessed from probability that function will recurse via given call expression.
5765 This parameter limits inlining only to call expression whose probability exceeds given threshold (in percents).
5766 The default value is 10.
5768 .It Sy inline-call-cost Ns
5769 Specify cost of call instruction relative to simple arithmetics operations (having cost of 1).
5770 Increasing this cost disqualifies inlining of non-leaf functions and at the same time increases size of leaf function that is believed to reduce function size by being inlined.
5771 In effect it increases amount of inlining for code having large abstraction penalty (many functions that just pass the arguments to other functions) and decrease inlining for code with low abstraction penalty.
5772 The default value is 16.
5774 .It Sy max-unrolled-insns Ns
5775 The maximum number of instructions that a loop should have if that loop is unrolled, and if the loop is unrolled, it determines how many times the loop code is unrolled.
5777 .It Sy max-average-unrolled-insns Ns
5778 The maximum number of instructions biased by probabilities of their execution that a loop should have if that loop is unrolled, and if the loop is unrolled, it determines how many times the loop code is unrolled.
5780 .It Sy max-unroll-times Ns
5781 The maximum number of unrollings of a single loop.
5783 .It Sy max-peeled-insns Ns
5784 The maximum number of instructions that a loop should have if that loop is peeled, and if the loop is peeled, it determines how many times the loop code is peeled.
5786 .It Sy max-peel-times Ns
5787 The maximum number of peelings of a single loop.
5789 .It Sy max-completely-peeled-insns Ns
5790 The maximum number of insns of a completely peeled loop.
5792 .It Sy max-completely-peel-times Ns
5793 The maximum number of iterations of a loop to be suitable for complete peeling.
5795 .It Sy max-unswitch-insns Ns
5796 The maximum number of insns of an unswitched loop.
5798 .It Sy max-unswitch-level Ns
5799 The maximum number of branches unswitched in a single loop.
5801 .It Sy lim-expensive Ns
5802 The minimum cost of an expensive expression in the loop invariant motion.
5804 .It Sy iv-consider-all-candidates-bound Ns
5805 Bound on number of candidates for induction variables below that all candidates are considered for each use in induction variable optimizations.
5806 Only the most relevant candidates are considered if there are more candidates, to avoid quadratic time complexity.
5808 .It Sy iv-max-considered-uses Ns
5809 The induction variable optimizations give up on loops that contain more induction variable uses.
5811 .It Sy iv-always-prune-cand-set-bound Ns
5812 If number of candidates in the set is smaller than this value, we always try to remove unnecessary ivs from the set during its optimization when a new iv is added to the set.
5814 .It Sy scev-max-expr-size Ns
5815 Bound on size of expressions used in the scalar evolutions analyzer.
5816 Large expressions slow the analyzer.
5818 .It Sy vect-max-version-checks Ns
5819 The maximum number of runtime checks that can be performed when doing loop versioning in the vectorizer.
5820 See option ftree-vect-loop-version for more information.
5822 .It Sy max-iterations-to-track Ns
5823 The maximum number of iterations of a loop the brute force algorithm for analysis of # of iterations of the loop tries to evaluate.
5825 .It Sy hot-bb-count-fraction Ns
5826 Select fraction of the maximal count of repetitions of basic block in program given basic block needs to have to be considered hot.
5828 .It Sy hot-bb-frequency-fraction Ns
5829 Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot
5831 .It Sy max-predicted-iterations Ns
5832 The maximum number of loop iterations we predict statically.
5833 This is useful in cases where function contain single loop with known bound and other loop with unknown.
5834 We predict the known number of iterations correctly, while the unknown number of iterations average to roughly 10.
5835 This means that the loop without bounds would appear artificially cold relative to the other one.
5837 .It Sy tracer-dynamic-coverage Ns
5838 .It Sy tracer-dynamic-coverage-feedback Ns
5839 This value is used to limit superblock formation once the given percentage of executed instructions is covered.
5840 This limits unnecessary code size expansion.
5843 .Sy tracer-dynamic-coverage-feedback
5844 is used only when profile feedback is available.
5845 The real profiles (as opposed to statically estimated ones) are much less balanced allowing the threshold to be larger value.
5847 .It Sy tracer-max-code-growth Ns
5848 Stop tail duplication once code growth has reached given percentage.
5849 This is rather hokey argument, as most of the duplicates will be eliminated later in cross jumping, so it may be set to much higher values than is the desired code growth.
5851 .It Sy tracer-min-branch-ratio Ns
5852 Stop reverse growth when the reverse probability of best edge is less than this threshold (in percent).
5854 .It Sy tracer-min-branch-ratio Ns
5855 .It Sy tracer-min-branch-ratio-feedback Ns
5856 Stop forward growth if the best edge do have probability lower than this threshold.
5859 .Sy tracer-dynamic-coverage
5860 two values are present, one for compilation for profile feedback and one for compilation without.
5861 The value for compilation with profile feedback needs to be more conservative (higher) in order to make tracer effective.
5863 .It Sy max-cse-path-length Ns
5864 Maximum number of basic blocks on path that cse considers.
5867 .It Sy max-cse-insns Ns
5868 The maximum instructions CSE process before flushing.
5869 The default is 1000.
5871 .It Sy global-var-threshold Ns
5872 Counts the number of function calls
5874 and the number of call-clobbered variables
5880 is larger than this limit, a single artificial variable will be created to represent all the call-clobbered variables at function call sites.
5881 This artificial variable will then be made to alias every call-clobbered variable.
5884 on the host machine; beware overflow).
5886 .It Sy max-aliased-vops Ns
5887 Maximum number of virtual operands allowed to represent aliases before triggering the alias grouping heuristic.
5888 Alias grouping reduces compile times and memory consumption needed for aliasing at the expense of precision loss in alias information.
5890 .It Sy ggc-min-expand Ns
5891 GCC uses a garbage collector to manage its own memory allocation.
5892 This parameter specifies the minimum percentage by which the garbage collector's heap should be allowed to expand between collections.
5893 Tuning this may improve compilation speed; it has no effect on code generation.
5895 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when RAM \*[Gt]= 1GB.
5898 is available, the notion of "RAM" is the smallest of actual RAM and
5902 If GCC is not able to calculate RAM on a particular platform, the lower bound of 30% is used.
5903 Setting this parameter and
5904 .Sy ggc-min-heapsize
5905 to zero causes a full collection to occur at every opportunity.
5906 This is extremely slow, but can be useful for debugging.
5908 .It Sy ggc-min-heapsize Ns
5909 Minimum size of the garbage collector's heap before it begins bothering to collect garbage.
5910 The first collection occurs after the heap expands by
5913 .Sy ggc-min-heapsize .
5914 Again, tuning this may improve compilation speed, and has no effect on code generation.
5916 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit which tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but with a lower bound of 4096 (four megabytes) and an upper bound of 131072 (128 megabytes).
5917 If GCC is not able to calculate RAM on a particular platform, the lower bound is used.
5918 Setting this parameter very large effectively disables garbage collection.
5919 Setting this parameter and
5921 to zero causes a full collection to occur at every opportunity.
5923 .It Sy max-reload-search-insns Ns
5924 The maximum number of instruction reload should look backward for equivalent register.
5925 Increasing values mean more aggressive optimization, making the compile time increase with probably slightly better performance.
5926 The default value is 100.
5928 .It Sy max-cselib-memory-location Ns
5929 The maximum number of memory locations cselib should take into account.
5930 Increasing values mean more aggressive optimization, making the compile time increase with probably slightly better performance.
5931 The default value is 500.
5933 .It Sy max-flow-memory-location Ns
5935 .Sy max-cselib-memory-location
5936 but for dataflow liveness.
5937 The default value is 100.
5939 .It Sy reorder-blocks-duplicate Ns
5940 .It Sy reorder-blocks-duplicate-feedback Ns
5941 Used by basic block reordering pass to decide whether to use unconditional branch or duplicate the code on its destination.
5942 Code is duplicated when its estimated size is smaller than this value multiplied by the estimated size of unconditional jump in the hot spots of the program.
5945 .Sy reorder-block-duplicate-feedback
5946 is used only when profile feedback is available and may be set to higher values than
5947 .Sy reorder-block-duplicate
5948 since information about the hot spots is more accurate.
5950 .It Sy max-sched-ready-insns Ns
5951 The maximum number of instructions ready to be issued the scheduler should consider at any given time during the first scheduling pass.
5952 Increasing values mean more thorough searches, making the compilation time increase with probably little benefit.
5953 The default value is 100.
5955 .It Sy max-sched-region-blocks Ns
5956 The maximum number of blocks in a region to be considered for interblock scheduling.
5957 The default value is 10.
5959 .It Sy max-sched-region-insns Ns
5960 The maximum number of insns in a region to be considered for interblock scheduling.
5961 The default value is 100.
5963 .It Sy min-sched-prob Ns
5964 The minimum probability of reaching a source block for interblock speculative scheduling.
5965 The default value is 40.
5967 .It Sy max-last-value-rtl Ns
5968 The maximum size measured as number of RTLs that can be recorded in an expression in combiner for a pseudo register as last known value of that register.
5969 The default is 10000.
5971 .It Sy integer-share-limit Ns
5972 Small integer constants can use a shared data structure, reducing the compiler's memory usage and increasing its speed.
5973 This sets the maximum value of a shared integer constant's.
5974 The default value is 256.
5976 .It Sy min-virtual-mappings Ns
5977 Specifies the minimum number of virtual mappings in the incremental SSA updater that should be registered to trigger the virtual mappings heuristic defined by virtual-mappings-ratio.
5978 The default value is 100.
5980 .It Sy virtual-mappings-ratio Ns
5981 If the number of virtual mappings is virtual-mappings-ratio bigger than the number of virtual symbols to be updated, then the incremental SSA updater switches to a full update for those symbols.
5982 The default ratio is 3.
5984 .It Sy ssp-buffer-size Ns
5985 The minimum size of buffers (i.e. arrays) that will receive stack smashing protection when
5986 .Fl fstack-protection
5989 .It Sy max-jump-thread-duplication-stmts Ns
5990 Maximum number of statements allowed in a block that needs to be duplicated when threading jumps.
5992 .It Sy max-fields-for-field-sensitive Ns
5993 Maximum number of fields in a structure we will treat in a field sensitive manner during pointer analysis.
5997 .Ss Options Controlling the Preprocessor
5998 These options control the C preprocessor, which is run on each C source file before actual compilation.
6002 option, nothing is done except preprocessing.
6003 Some of these options make sense only together with
6005 because they cause the preprocessor output to be unsuitable for actual compilation.
6008 .It Fl Wp, Ns Ar option
6010 .Fl Wp, Ns Ar option
6011 to bypass the compiler driver and pass
6013 directly through to the preprocessor.
6016 contains commas, it is split into multiple options at the commas.
6017 However, many options are modified, translated or interpreted by the compiler driver before being passed to the preprocessor, and
6019 forcibly bypasses this phase.
6020 The preprocessor's direct interface is undocumented and subject to change, so whenever possible you should avoid using
6022 and let the driver handle the options instead.
6024 .It Fl Xpreprocessor Ar option
6027 as an option to the preprocessor.
6028 You can use this to supply system-specific preprocessor options which GCC does not know how to recognize.
6030 If you want to pass an option that takes an argument, you must use
6032 twice, once for the option and once for the argument.
6039 as a macro, with definition
6042 .It Fl D Ar name Ns = Ns Ar definition
6045 are tokenized and processed as if they appeared during translation phase three in a
6048 In particular, the definition will be truncated by embedded newline characters.
6050 If you are invoking the preprocessor from a shell or shell-like program you may need to use the shell's quoting syntax to protect characters such as spaces that have a meaning in the shell syntax.
6052 If you wish to define a function-like macro on the command line, write its argument list with surrounding parentheses before the equals sign (if any).
6053 Parentheses are meaningful to most shells, so you will need to quote the option.
6070 options are processed in the order they are given on the command line.
6075 options are processed after all
6082 Cancel any previous definition of
6084 either built in or provided with a
6089 Do not predefine any system-specific or GCC-specific macros.
6090 The standard predefined macros remain defined.
6095 to the list of directories to be searched for header files.
6096 Directories named by
6098 are searched before the standard system include directories.
6101 is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated .
6106 This is the same as specifying
6108 as the second non-option argument to
6111 has a different interpretation of a second non-option argument, so you must use
6113 to specify the output file.
6116 Turns on all optional warnings which are desirable for normal code.
6121 and a warning about integer promotion causing a change of sign in
6124 Note that many of the preprocessor's warnings are on by default and have no options to control them.
6128 Warn whenever a comment-start sequence
6132 comment, or whenever a backslash-newline appears in a
6135 (Both forms have the same effect.)
6138 @anchor{Wtrigraphs} Most trigraphs in comments cannot affect the meaning of the program.
6139 However, a trigraph that would form an escaped newline
6141 at the end of a line) can, by changing where the comment begins or ends.
6142 Therefore, only trigraphs that would form escaped newlines produce warnings inside a comment.
6144 This option is implied by
6148 is not given, this option is still enabled unless trigraphs are enabled.
6149 To get trigraph conversion without warnings, but get the other
6152 .Fl trigraphs Fl Wall Fl Wno-trigraphs .
6155 Warn about certain constructs that behave differently in traditional and ISO C.
6156 Also warn about ISO C constructs that have no traditional C equivalent, and problematic constructs which should be avoided.
6164 Warn whenever an identifier which is not a macro is encountered in an
6166 directive, outside of
6168 Such identifiers are replaced with zero.
6170 .It Fl Wunused-macros
6171 Warn about macros defined in the main file that are unused.
6174 if it is expanded or tested for existence at least once.
6175 The preprocessor will also warn if the macro has not been used at the time it is redefined or undefined.
6177 Built-in macros, macros defined on the command line, and macros defined in include files are not warned about.
6180 If a macro is actually used, but only used in skipped conditional blocks, then CPP will report it as unused.
6181 To avoid the warning in such a case, you might improve the scope of the macro's definition by, for example, moving it into the first skipped block.
6182 Alternatively, you could provide a dummy use with something like:
6184 .Bd -literal -offset indent
6185 #if defined the_macro_causing_the_warning
6188 .It Fl Wendif-labels
6193 are followed by text.
6194 This usually happens in code of the form
6196 .Bd -literal -offset indent
6203 The second and third
6205 should be in comments, but often are not in older programs.
6206 This warning is on by default.
6209 Make all warnings into hard errors.
6210 Source code which triggers warnings will be rejected.
6212 .It Fl Wsystem-headers
6213 Issue warnings for code in system headers.
6214 These are normally unhelpful in finding bugs in your own code, therefore suppressed.
6215 If you are responsible for the system library, you may want to see them.
6218 Suppress all warnings, including those which GNU CPP issues by default.
6221 Issue all the mandatory diagnostics listed in the C standard.
6222 Some of them are left out by default, since they trigger frequently on harmless code.
6224 .It Fl pedantic-errors
6225 Issue all the mandatory diagnostics, and make all mandatory diagnostics into errors.
6226 This includes mandatory diagnostics that GCC issues without
6228 but treats as warnings.
6231 Instead of outputting the result of preprocessing, output a rule suitable for
6233 describing the dependencies of the main source file.
6234 The preprocessor outputs one
6236 rule containing the object file name for that source file, a colon, and the names of all the included files, including those coming from
6240 command line options.
6242 Unless specified explicitly (with
6246 the object file name consists of the basename of the source file with any suffix replaced with object file suffix.
6247 If there are many included files then the rule is split into several lines using
6250 The rule has no commands.
6252 This option does not suppress the preprocessor's debug output, such as
6254 To avoid mixing such debug output with the dependency rules you should explicitly specify the dependency output file with
6256 or use an environment variable like
6257 .Sy DEPENDENCIES_OUTPUT .
6258 Debug output will still be sent to the regular output stream as normal.
6262 to the driver implies
6264 and suppresses warnings with an implicit
6270 but do not mention header files that are found in system header directories, nor header files that are included, directly or indirectly, from such a header.
6272 This implies that the choice of angle brackets or double quotes in an
6274 directive does not in itself determine whether that header will appear in
6277 This is a slight change in semantics from GCC versions 3.0 and earlier.
6286 specifies a file to write the dependencies to.
6289 switch is given the preprocessor sends the rules to the same place it would have sent preprocessed output.
6291 When used with the driver options
6296 overrides the default dependency output file.
6299 In conjunction with an option such as
6301 requesting dependency generation,
6303 assumes missing header files are generated files and adds them to the dependency list without raising an error.
6304 The dependency filename is taken directly from the
6306 directive without prepending any path.
6308 also suppresses preprocessed output, as a missing header file renders this useless.
6310 This feature is used in automatic updating of makefiles.
6313 This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing.
6314 These dummy rules work around errors
6316 gives if you remove header files without updating the
6320 This is typical output:
6322 .Bd -literal -offset indent
6323 test.o: test.c test.h
6328 Change the target of the rule emitted by dependency generation.
6329 By default CPP takes the name of the main input file, including any path, deletes any file suffix such as
6331 and appends the platform's usual object suffix.
6332 The result is the target.
6336 option will set the target to be exactly the string you specify.
6337 If you want multiple targets, you can specify them as a single argument to
6344 .Sy -MT '$(objpfx)foo.o'
6347 .Bd -literal -offset indent
6348 $(objpfx)foo.o: foo.c
6353 but it quotes any characters which are special to Make.
6354 .Sy -MQ '$(objpfx)foo.o'
6357 .Bd -literal -offset indent
6358 $$(objpfx)foo.o: foo.c
6360 The default target is automatically quoted, as if it were given with
6366 .Fl M Fl MF Ar file ,
6370 The driver determines
6375 If it is, the driver uses its argument but with a suffix of
6377 otherwise it take the basename of the input file and applies a
6383 is used in conjunction with
6387 switch is understood to specify the dependency output file (but @pxref{dashMF,,-MF}), but if used without
6391 is understood to specify a target object file.
6397 can be used to generate a dependency output file as a side-effect of the compilation process.
6402 except mention only user header files, not system header files.
6405 When using precompiled headers, this flag will cause the dependency-output flags to also list the files from the precompiled header's dependencies.
6406 If not specified only the precompiled header would be listed and not the files that were used to create it because those files are not consulted when a precompiled header is used.
6408 .It Fl fpch-preprocess
6409 This option allows use of a precompiled header together with
6411 It inserts a special
6413 .Va #pragma GCC pch_preprocess \&"\*[Lt]filename\*[Gt]"
6414 in the output to mark the place where the precompiled header was found, and its filename.
6417 is in use, GCC recognizes this
6421 This option is off by default, because the resulting preprocessed output is only really suitable as input to GCC.
6422 It is switched on by
6425 You should not write this
6427 in your own code, but it is safe to edit the filename if the PCH file is available in a different location.
6428 The filename may be absolute or it may be relative to GCC's current directory.
6432 .It Fl x Ar objective-c
6433 .It Fl x Ar assembler-with-cpp
6434 Specify the source language: C, C++, Objective-C, or assembly.
6435 This has nothing to do with standards conformance or extensions; it merely selects which base syntax to expect.
6436 If you give none of these options, cpp will deduce the language from the extension of the source file:
6442 Some other common extensions for C++ and assembly are also recognized.
6443 If cpp does not recognize the extension, it will treat the file as C; this is the most generic mode.
6446 Previous versions of cpp accepted a
6448 option which selected both the language and the standards conformance level.
6449 This option has been removed, because it conflicts with the
6453 .It Fl std= Ns Ar standard
6455 Specify the standard to which the code should conform.
6456 Currently CPP knows about C and C++ standards; others may be added in the future.
6462 .It Sy iso9899:1990 Ns
6464 The ISO C standard from 1990.
6466 is the customary shorthand for this version of the standard.
6470 option is equivalent to
6473 .It Sy iso9899:199409 Ns
6474 The 1990 C standard, as amended in 1994.
6476 .It Sy iso9899:1999 Ns
6478 .It Sy iso9899:199x Ns
6480 The revised ISO C standard, published in December 1999.
6481 Before publication, this was known as C9X.
6484 The 1990 C standard plus GNU extensions.
6485 This is the default.
6489 The 1999 C standard plus GNU extensions.
6492 The 1998 ISO C++ standard plus amendments.
6497 plus GNU extensions.
6498 This is the default for C++ code.
6502 Split the include path.
6503 Any directories specified with
6507 are searched only for headers requested with
6508 .Va .Sy #include \&"file" ;
6509 they are not searched for
6510 .Va .Sy #include \*[Lt]file\*[Gt] .
6511 If additional directories are specified with
6515 those directories are searched for all
6521 inhibits the use of the directory of the current file directory as the first search directory for
6522 .Va .Sy #include \&"file" .
6523 This option has been deprecated.
6526 Do not search the standard system directories for header files.
6527 Only the directories you have specified with
6529 options (and the directory of the current file, if appropriate) are searched.
6532 Do not search for header files in the C++-specific standard directories, but do still search the other standard directories.
6533 (This option is used when building the C++ library.)
6535 .It Fl include Ar file
6539 .Va #include \&"file"
6540 appeared as the first line of the primary source file.
6541 However, the first directory searched for
6543 is the preprocessor's working directory
6545 the directory containing the main source file.
6546 If not found there, it is searched for in the remainder of the
6547 .Va #include \&"..."
6548 search chain as normal.
6552 options are given, the files are included in the order they appear on the command line.
6554 .It Fl imacros Ar file
6557 except that any output produced by scanning
6560 Macros it defines remain defined.
6561 This allows you to acquire all the macros from a header without also processing its declarations.
6563 All files specified by
6565 are processed before all files specified by
6568 .It Fl idirafter Ar dir
6571 for header files, but do it
6573 all directories specified with
6575 and the standard system directories have been exhausted.
6577 is treated as a system include directory.
6579 .It Fl iprefix Ar prefix
6582 as the prefix for subsequent
6585 If the prefix represents a directory, you should include the final
6588 .It Fl iwithprefix Ar dir
6589 .It Fl iwithprefixbefore Ar dir
6592 to the prefix specified previously with
6594 and add the resulting directory to the include search path.
6595 .Fl iwithprefixbefore
6596 puts it in the same place
6604 .It Fl isysroot Ar dir
6605 This option is like the
6607 option, but applies only to header files.
6610 option for more information.
6612 .It Fl isystem Ar dir
6615 for header files, after all directories specified by
6617 but before the standard system directories.
6618 Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories.
6620 .It Fl cxx-isystem Ar dir
6623 for C++ header files, after all directories specified by
6625 but before the standard system directories.
6626 Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories.
6628 .It Fl iquote Ar dir
6631 only for header files requested with
6632 .Va .Sy #include \&"file" ;
6633 they are not searched for
6634 .Va .Sy #include \*[Lt]file\*[Gt] ,
6635 before all directories specified by
6637 and before the standard system directories.
6639 .It Fl fdollars-in-identifiers
6640 @anchor{fdollars-in-identifiers} Accept
6644 .It Fl fextended-identifiers
6645 Accept universal character names in identifiers.
6646 This option is experimental; in a future version of GCC, it will be enabled by default for C99 and C++.
6648 .It Fl fpreprocessed
6649 Indicate to the preprocessor that the input file has already been preprocessed.
6650 This suppresses things like macro expansion, trigraph conversion, escaped newline splicing, and processing of most directives.
6651 The preprocessor still recognizes and removes comments, so that you can pass a file preprocessed with
6653 to the compiler without problems.
6654 In this mode the integrated preprocessor is little more than a tokenizer for the front ends.
6657 is implicit if the input file has one of the extensions
6662 These are the extensions that GCC uses for preprocessed files created by
6665 .It Fl ftabstop= Ns Ar width
6666 Set the distance between tab stops.
6667 This helps the preprocessor report correct column numbers in warnings or errors, even if tabs appear on the line.
6668 If the value is less than 1 or greater than 100, the option is ignored.
6671 .It Fl fexec-charset= Ns Ar charset
6672 Set the execution character set, used for string and character constants.
6673 The default is UTF-8.
6675 can be any encoding supported by the system's
6679 .It Fl fwide-exec-charset= Ns Ar charset
6680 Set the wide execution character set, used for wide string and character constants.
6681 The default is UTF-32 or UTF-16, whichever corresponds to the width of
6686 can be any encoding supported by the system's
6688 library routine; however, you will have problems with encodings that do not fit exactly in
6691 .It Fl finput-charset= Ns Ar charset
6692 Set the input character set, used for translation from the character set of the input file to the source character set used by GCC.
6693 If the locale does not specify, or GCC cannot get this information from the locale, the default is UTF-8.
6694 This can be overridden by either the locale or this command line option.
6695 Currently the command line option takes precedence if there's a conflict.
6697 can be any encoding supported by the system's
6701 .It Fl fworking-directory
6702 Enable generation of linemarkers in the preprocessor output that will let the compiler know the current working directory at the time of preprocessing.
6703 When this option is enabled, the preprocessor will emit, after the initial linemarker, a second linemarker with the current working directory followed by two slashes.
6704 GCC will use this directory, when it's present in the preprocessed input, as the directory emitted as the current working directory in some debugging information formats.
6705 This option is implicitly enabled if debugging information is enabled, but this can be inhibited with the negated form
6706 .Fl fno-working-directory .
6709 flag is present in the command line, this option has no effect, since no
6711 directives are emitted whatsoever.
6713 .It Fl fno-show-column
6714 Do not print column numbers in diagnostics.
6715 This may be necessary if diagnostics are being scanned by a program that does not understand the column numbers, such as
6718 .It Fl A Ar predicate Ns = Ns Ar answer
6719 Make an assertion with the predicate
6723 This form is preferred to the older form
6728 which is still supported, because it does not use shell special characters.
6730 .It Fl A Fl Ns Ar predicate Ns = Ns Ar answer
6731 Cancel an assertion with the predicate
6738 is a sequence of one or more of the following characters, and must not be preceded by a space.
6739 Other characters are interpreted by the compiler proper, or reserved for future versions of GCC, and so are silently ignored.
6740 If you specify characters whose behavior conflicts, the result is undefined.
6744 Instead of the normal output, generate a list of
6746 directives for all the macros defined during the execution of the preprocessor, including predefined macros.
6747 This gives you a way of finding out what is predefined in your version of the preprocessor.
6748 Assuming you have no file
6752 .Bd -literal -offset indent
6753 touch foo.h; cpp -dM foo.h
6755 will show all the predefined macros.
6760 except in two respects: it does
6762 include the predefined macros, and it outputs
6766 directives and the result of preprocessing.
6767 Both kinds of output go to the standard output file.
6772 but emit only the macro names, not their expansions.
6777 directives in addition to the result of preprocessing.
6781 Inhibit generation of linemarkers in the output from the preprocessor.
6782 This might be useful when running the preprocessor on something that is not C code, and will be sent to a program which might be confused by the linemarkers.
6785 Do not discard comments.
6786 All comments are passed through to the output file, except for comments in processed directives, which are deleted along with the directive.
6788 You should be prepared for side effects when using
6790 it causes the preprocessor to treat comments as tokens in their own right.
6791 For example, comments appearing at the start of what would be a directive line have the effect of turning that line into an ordinary source line, since the first token on the line is no longer a
6795 Do not discard comments, including during macro expansion.
6798 except that comments contained within macros are also passed through to the output file where the macro is expanded.
6800 In addition to the side-effects of the
6804 option causes all C++-style comments inside a macro to be converted to C-style comments.
6805 This is to prevent later use of that macro from inadvertently commenting out the remainder of the source line.
6809 option is generally used to support lint comments.
6811 .It Fl traditional-cpp
6812 Try to imitate the behavior of old-fashioned C preprocessors, as opposed to ISO C preprocessors.
6815 Process trigraph sequences.
6816 These are three-character sequences, all starting with
6818 that are defined by ISO C to stand for single characters.
6825 is a character constant for a newline.
6826 By default, GCC ignores trigraphs, but in standard-conforming modes it converts them.
6833 The nine trigraphs and their replacements are
6835 .Bd -literal -offset indent
6836 Trigraph: ??( ??) ??\*[Lt] ??\*[Gt] ??= ??/ ??' ??! ??-
6837 Replacement: [ ] { } # \e ^ | ~
6840 Enable special code to work around file systems which only permit very short file names, such as MS-DOS.
6844 Print text describing all the command line options instead of preprocessing anything.
6848 Print out GNU CPP's version number at the beginning of execution, and report the final form of the include path.
6851 Print the name of each header file used, in addition to other normal activities.
6852 Each name is indented to show how deep in the
6855 Precompiled header files are also printed, even if they are found to be invalid; an invalid precompiled header file is printed with
6857 and a valid one with
6862 Print out GNU CPP's version number.
6863 With one dash, proceed to preprocess as normal.
6864 With two dashes, exit immediately.
6867 .Ss Passing Options to the Assembler
6868 You can pass options to the assembler.
6871 .It Fl Wa, Ns Ar option
6874 as an option to the assembler.
6877 contains commas, it is split into multiple options at the commas.
6879 .It Fl Xassembler Ar option
6882 as an option to the assembler.
6883 You can use this to supply system-specific assembler options which GCC does not know how to recognize.
6885 If you want to pass an option that takes an argument, you must use
6887 twice, once for the option and once for the argument.
6890 .Ss Options for Linking
6891 These options come into play when the compiler links object files into an executable output file.
6892 They are meaningless if the compiler is not doing a link step.
6895 .It Em object-file-name Ns
6896 A file name that does not end in a special recognized suffix is considered to name an object file or library.
6897 (Object files are distinguished from libraries by the linker according to the file contents.) If linking is done, these object files are used as input to the linker.
6902 If any of these options is used, then the linker is not run, and object file names should not be used as arguments.
6904 .It Fl l Ns Ar library
6906 Search the library named
6909 (The second alternative with the library as a separate argument is only for POSIX compliance and is not recommended.)
6911 It makes a difference where in the command you write this option; the linker searches and processes libraries and object files in the order they are specified.
6922 refers to functions in
6924 those functions may not be loaded.
6926 The linker searches a standard list of directories for the library, which is actually a file named
6928 The linker then uses this file as if it had been specified precisely by name.
6930 The directories searched include several standard system directories plus any that you specify with
6933 Normally the files found this way are library files---archive files whose members are object files.
6934 The linker handles an archive file by scanning through it for members which define symbols that have so far been referenced but not defined.
6935 But if the file that is found is an ordinary object file, it is linked in the usual fashion.
6936 The only difference between using an
6938 option and specifying a file name is that
6946 and searches several directories.
6949 You need this special case of the
6951 option in order to link an Objective-C or Objective-C++ program.
6954 Do not use the standard system startup files when linking.
6955 The standard system libraries are used normally, unless
6961 .It Fl nodefaultlibs
6962 Do not use the standard system libraries when linking.
6963 Only the libraries you specify will be passed to the linker.
6964 The standard startup files are used normally, unless
6967 The compiler may generate calls to
6973 These entries are usually resolved by entries in libc.
6974 These entry points should be supplied through some other mechanism when this option is specified.
6977 Do not use the standard system startup files or libraries when linking.
6978 No startup files and only the libraries you specify will be passed to the linker.
6979 The compiler may generate calls to
6985 These entries are usually resolved by entries in libc.
6986 These entry points should be supplied through some other mechanism when this option is specified.
6988 One of the standard libraries bypassed by
6994 a library of internal subroutines that GCC uses to overcome shortcomings of particular machines, or special needs for some languages.
6996 In most cases, you need
6998 even when you want to avoid other standard libraries.
6999 In other words, when you specify
7003 you should usually specify
7006 This ensures that you have no unresolved references to internal GCC library subroutines.
7009 used to ensure C++ constructors will be called.)
7012 Produce a position independent executable on targets which support it.
7013 For predictable results, you must also specify the same set of options that were used to generate code
7016 or model suboptions) when you specify this option.
7021 to the ELF linker, on targets that support it.
7022 This instructs the linker to add all symbols, not only used ones, to the dynamic symbol table.
7023 This option is needed for some uses of
7025 or to allow obtaining backtraces from within a program.
7028 Remove all symbol table and relocation information from the executable.
7031 On systems that support dynamic linking, this prevents linking with the shared libraries.
7032 On other systems, this option has no effect.
7035 Produce a shared object which can then be linked with other objects to form an executable.
7036 Not all systems support this option.
7037 For predictable results, you must also specify the same set of options that were used to generate code
7040 or model suboptions) when you specify this option.[1]
7042 .It Fl shared-libgcc
7043 .It Fl static-libgcc
7044 On systems that provide
7046 as a shared library, these options force the use of either the shared or static version respectively.
7047 If no shared version of
7049 was built when the compiler was configured, these options have no effect.
7051 There are several situations in which an application should use the shared
7053 instead of the static version.
7054 The most common of these is when the application wishes to throw and catch exceptions across different shared libraries.
7055 In that case, each of the libraries as well as the application itself should use the shared
7058 Therefore, the G++ and GCJ drivers automatically add
7060 whenever you build a shared library or a main executable, because C++ and Java programs typically use exceptions, so this is the right thing to do.
7062 If, instead, you use the GCC driver to create shared libraries, you may find that they will not always be linked with the shared
7064 If GCC finds, at its configuration time, that you have a non-GNU linker or a GNU linker that does not support option
7066 it will link the shared version of
7068 into shared libraries by default.
7069 Otherwise, it will take advantage of the linker and optimize away the linking with the shared version of
7071 linking with the static version of libgcc by default.
7072 This allows exceptions to propagate through such shared libraries, without incurring relocation costs at library load time.
7074 However, if a library or main executable is supposed to throw or catch exceptions, you must link it using the G++ or GCJ driver, as appropriate for the languages used in the program, or using the option
7076 such that it is linked with the shared
7080 Bind references to global symbols when building a shared object.
7081 Warn about any unresolved references (unless overridden by the link editor option
7082 .Fl Xlinker Fl z Fl Xlinker Ar defs ) .
7083 Only a few systems support this option.
7085 .It Fl Xlinker Ar option
7088 as an option to the linker.
7089 You can use this to supply system-specific linker options which GCC does not know how to recognize.
7091 If you want to pass an option that takes an argument, you must use
7093 twice, once for the option and once for the argument.
7094 For example, to pass
7095 .Fl assert Ar definitions ,
7097 .Fl Xlinker Fl assert Fl Xlinker Ar definitions .
7098 It does not work to write
7099 .Sy -Xlinker \&"-assert definitions" ,
7100 because this passes the entire string as a single argument, which is not what the linker expects.
7102 .It Fl Wl, Ns Ar option
7105 as an option to the linker.
7108 contains commas, it is split into multiple options at the commas.
7113 is undefined, to force linking of library modules to define it.
7116 multiple times with different symbols to force loading of additional library modules.
7119 .Ss Options for Directory Search
7120 These options specify directories to search for header files, for libraries and for parts of the compiler:
7126 to the head of the list of directories to be searched for header files.
7127 This can be used to override a system header file, substituting your own version, since these directories are searched before the system header file directories.
7128 However, you should not use this option to add directories that contain vendor-supplied system header files (use
7131 If you use more than one
7133 option, the directories are scanned in left-to-right order; the standard system directories come after.
7135 If a standard system include directory, or a directory specified with
7137 is also specified with
7141 option will be ignored.
7142 The directory will still be searched but as a system directory at its normal position in the system include chain.
7143 This is to ensure that GCC's procedure to fix buggy system headers and the ordering for the include_next directive are not inadvertently changed.
7144 If you really need to change the search order for system directories, use the
7150 .It Fl iquote Ns Ar dir
7153 to the head of the list of directories to be searched for header files only for the case of
7157 they are not searched for
7167 to the list of directories to be searched for
7170 .It Fl B Ns Ar prefix
7171 This option specifies where to find the executables, libraries, include files, and data files of the compiler itself.
7173 The compiler driver program runs one or more of the subprograms
7181 as a prefix for each program it tries to run, both with and without
7187 For each subprogram to be run, the compiler driver first tries the
7190 If that name is not found, or if
7192 was not specified, the driver tries two standard prefixes, which are
7195 .Pa /usr/local/lib/gcc/ .
7196 If neither of those results in a file name that is found, the unmodified program name is searched for using the directories specified in your
7198 environment variable.
7200 The compiler will check to see if the path provided by the
7202 refers to a directory, and if necessary it will add a directory separator character at the end of the path.
7205 prefixes that effectively specify directory names also apply to libraries in the linker, because the compiler translates these options into
7207 options for the linker.
7208 They also apply to includes files in the preprocessor, because the compiler translates these options into
7210 options for the preprocessor.
7211 In this case, the compiler appends
7215 The run-time support file
7217 can also be searched for using the
7220 If it is not found there, the two standard prefixes above are tried, and that is all.
7221 The file is left out of the link if it is not found by those means.
7223 Another way to specify a prefix much like the
7225 prefix is to use the environment variable
7226 .Sy GCC_EXEC_PREFIX .
7228 As a special kludge, if the path provided by
7234 is a number in the range 0 to 9, then it will be replaced by
7236 This is to help with boot-strapping the compiler.
7238 .It Fl specs= Ns Ar file
7241 after the compiler reads in the standard
7243 file, in order to override the defaults that the
7245 driver program uses when determining what switches to pass to
7252 .Fl specs= Ns Ar file
7253 can be specified on the command line, and they are processed in order, from left to right.
7255 .It Fl -sysroot= Ns Ar dir
7258 as the logical root directory for headers and libraries.
7259 For example, if the compiler would normally search for headers in
7263 it will instead search
7268 If you use both this option and the
7272 option will apply to libraries, but the
7274 option will apply to header files.
7276 The GNU linker (beginning with version 2.16) has the necessary support for this option.
7277 If your linker does not support this option, the header file aspect of
7279 will still work, but the library aspect will not.
7282 This option has been deprecated.
7287 directories before the
7291 Any directories you specify with
7295 option are searched only for the case of
7299 they are not searched for
7304 If additional directories are specified with
7308 these directories are searched for all
7314 directories are used this way.)
7318 option inhibits the use of the current directory (where the current input file came from) as the first search directory for
7322 There is no way to override this effect of
7326 you can specify searching the directory which was current when the compiler was invoked.
7327 That is not exactly the same as what the preprocessor does by default, but it is often satisfactory.
7330 does not inhibit the use of the standard system directories for header files.
7338 .Ss Specifying Target Machine and Compiler Version
7339 The usual way to run GCC is to run the executable called
7342 .Pa \*[Lt]machine\*[Gt]-gcc
7343 when cross-compiling, or
7344 .Pa \*[Lt]machine\*[Gt]-gcc-\*[Lt]version\*[Gt]
7345 to run a version other than the one that was installed last.
7346 Sometimes this is inconvenient, so GCC provides options that will switch to another cross-compiler or version.
7352 specifies the target machine for compilation.
7354 The value to use for
7356 is the same as was specified as the machine type when configuring GCC as a cross-compiler.
7357 For example, if a cross-compiler was configured with
7358 .Sy configure arm-elf ,
7359 meaning to compile for an arm processor with elf binaries, then you would specify
7361 to run that cross compiler.
7362 Because there are other options beginning with
7364 the configuration must contain a hyphen.
7369 specifies which version of GCC to run.
7370 This is useful when multiple versions are installed.
7375 meaning to run GCC version 4.0.
7382 options work by running the
7383 .Pa \*[Lt]machine\*[Gt]-gcc-\*[Lt]version\*[Gt]
7384 executable, so there's no real reason to use them if you can just run that directly.
7385 .Ss Hardware Models and Configurations
7386 Earlier we discussed the standard option
7388 which chooses among different installed compilers for completely different target machines, such as VAX vs. 68000 vs. 80386.
7390 In addition, each of these target machine types can have its own special options, starting with
7392 to choose among various hardware models or configurations---for example, 68010 vs 68020, floating coprocessor or none.
7393 A single installed version of the compiler can compile for any model or configuration, according to the options specified.
7395 Some configurations of the compiler also support additional special options, usually for compatibility with other compilers on the same platform.
7399 These options are defined for ARC implementations:
7403 Compile code for little endian mode.
7404 This is the default.
7407 Compile code for big endian mode.
7410 Prepend the name of the cpu to all public symbol names.
7411 In multiple-processor systems, there are many ARC variants with different instruction and register set characteristics.
7412 This flag prevents code compiled for one cpu to be linked with code compiled for another.
7413 No facility exists for handling variants that are "almost identical".
7414 This is an all or nothing option.
7416 .It Fl mcpu= Ns Ar cpu
7417 Compile code for ARC variant
7419 Which variants are supported depend on the configuration.
7420 All variants support
7422 this is the default.
7424 .It Fl mtext= Ns Ar text-section
7425 .It Fl mdata= Ns Ar data-section
7426 .It Fl mrodata= Ns Ar readonly-data-section
7427 Put functions, data, and readonly data in
7431 .Em readonly-data-section
7432 respectively by default.
7433 This can be overridden with the
7441 options are defined for Advanced RISC Machines (ARM) architectures:
7444 .It Fl mabi= Ns Ar name
7445 Generate code for the specified ABI.
7446 Permissible values are:
7455 Generate a stack frame that is compliant with the ARM Procedure Call Standard for all functions, even if this is not strictly necessary for correct execution of the code.
7457 .Fl fomit-frame-pointer
7458 with this option will cause the stack frames not to be generated for leaf functions.
7460 .Fl mno-apcs-frame .
7463 This is a synonym for
7466 .It Fl mthumb-interwork
7467 Generate code which supports calling between the ARM and Thumb instruction sets.
7468 Without this option the two instruction sets cannot be reliably used inside one program.
7470 .Fl mno-thumb-interwork ,
7471 since slightly larger code is generated when
7472 .Fl mthumb-interwork
7475 .It Fl mno-sched-prolog
7476 Prevent the reordering of instructions in the function prolog, or the merging of those instruction with the instructions in the function's body.
7477 This means that all functions will start with a recognizable set of instructions (or in fact one of a choice from a small set of different function prologues), and this information can be used to locate the start if functions inside an executable piece of code.
7482 Generate output containing floating point instructions.
7483 This is the default.
7486 Generate output containing library calls for floating point.
7488 the requisite libraries are not available for all ARM targets.
7489 Normally the facilities of the machine's usual C compiler are used, but this cannot be done directly in cross-compilation.
7490 You must make your own arrangements to provide suitable library functions for cross-compilation.
7493 changes the calling convention in the output file; therefore, it is only useful if you compile
7495 of a program with this option.
7496 In particular, you need to compile
7498 the library that comes with GCC, with
7500 in order for this to work.
7502 .It Fl mfloat-abi= Ns Ar name
7503 Specifies which ABI to use for floating point values.
7504 Permissible values are:
7519 allows the generation of floating point instructions, but still uses the soft-float calling conventions.
7521 .It Fl mlittle-endian
7522 Generate code for a processor running in little-endian mode.
7523 This is the default for all standard configurations.
7526 Generate code for a processor running in big-endian mode; the default is to compile code for a little-endian processor.
7528 .It Fl mwords-little-endian
7529 This option only applies when generating code for big-endian processors.
7530 Generate code for a little-endian word order but a big-endian byte order.
7531 That is, a byte order of the form
7533 Note: this option should only be used if you require compatibility with code for big-endian ARM processors generated by versions of the compiler prior to 2.8.
7535 .It Fl mcpu= Ns Ar name
7536 This specifies the name of the target ARM processor.
7537 GCC uses this name to determine what kind of instructions it can emit when generating assembly code.
7538 Permissible names are:
7596 .It Fl mtune= Ns Ar name
7597 This option is very similar to the
7599 option, except that instead of specifying the actual target processor type, and hence restricting which instructions can be used, it specifies that GCC should tune the performance of the code as if the target were of the type specified in this option, but still choosing the instructions that it will generate based on the cpu specified by a
7602 For some ARM implementations better performance can be obtained by using this option.
7604 .It Fl march= Ns Ar name
7605 This specifies the name of the target ARM architecture.
7606 GCC uses this name to determine what kind of instructions it can emit when generating assembly code.
7607 This option can be used in conjunction with or instead of the
7610 Permissible names are:
7625 .It Fl mfpu= Ns Ar name
7626 .It Fl mfpe= Ns Ar number
7627 .It Fl mfp= Ns Ar number
7628 This specifies what floating point hardware (or hardware emulation) is available on the target.
7629 Permissible names are:
7643 for compatibility with older versions of GCC.
7647 is specified this specifies the format of floating point values.
7649 .It Fl mstructure-size-boundary= Ns Ar n
7650 The size of all structures and unions will be rounded up to a multiple of the number of bits set by this option.
7651 Permissible values are 8, 32 and 64.
7652 The default value varies for different toolchains.
7653 For the COFF targeted toolchain the default value is 8.
7654 A value of 64 is only allowed if the underlying ABI supports it.
7656 Specifying the larger number can produce faster, more efficient code, but can also increase the size of the program.
7657 Different values are potentially incompatible.
7658 Code compiled with one value cannot necessarily expect to work with code or libraries compiled with another value, if they exchange information using structures or unions.
7660 .It Fl mabort-on-noreturn
7661 Generate a call to the function
7666 It will be executed if the function tries to return.
7669 .It Fl mno-long-calls
7670 Tells the compiler to perform function calls by first loading the address of the function into a register and then performing a subroutine call on this register.
7671 This switch is needed if the target function will lie outside of the 64 megabyte addressing range of the offset based version of subroutine call instruction.
7673 Even if this switch is enabled, not all function calls will be turned into long calls.
7674 The heuristic is that static functions, functions which have the
7676 attribute, functions that are inside the scope of a
7677 .Sy #pragma no_long_calls
7678 directive and functions whose definitions have already been compiled within the current compilation unit, will not be turned into long calls.
7679 The exception to this rule is that weak function definitions, functions with the
7683 attribute, and functions that are within the scope of a
7684 .Sy #pragma long_calls
7685 directive, will always be turned into long calls.
7687 This feature is not enabled by default.
7690 will restore the default behavior, as will placing the function calls within the scope of a
7691 .Sy #pragma long_calls_off
7693 Note these switches have no effect on how the compiler generates code to handle function calls via function pointers.
7695 .It Fl mnop-fun-dllimport
7696 Disable support for the
7700 .It Fl msingle-pic-base
7701 Treat the register used for PIC addressing as read-only, rather than loading it in the prologue for each function.
7702 The run-time system is responsible for initializing this register with an appropriate value before execution begins.
7704 .It Fl mpic-register= Ns Ar reg
7705 Specify the register to be used for PIC addressing.
7706 The default is R10 unless stack-checking is enabled, when R9 is used.
7708 .It Fl mcirrus-fix-invalid-insns
7709 Insert NOPs into the instruction stream to in order to work around problems with invalid Maverick instruction combinations.
7710 This option is only valid if the
7712 option has been used to enable generation of instructions for the Cirrus Maverick floating point co-processor.
7713 This option is not enabled by default, since the problem is only present in older Maverick implementations.
7714 The default can be re-enabled by use of the
7715 .Fl mno-cirrus-fix-invalid-insns
7718 .It Fl mpoke-function-name
7719 Write the name of each function into the text section, directly preceding the function prologue.
7720 The generated code is similar to this:
7722 .Bd -literal -offset indent
7724 .ascii "arm_poke_function_name", 0
7727 .word 0xff000000 + (t1 - t0)
7728 arm_poke_function_name
7730 stmfd sp!, {fp, ip, lr, pc}
7733 When performing a stack backtrace, code can inspect the value of
7737 If the trace function then looks at location
7739 and the top 8 bits are set, then we know that there is a function name embedded immediately preceding this location and has length
7740 .Va ((pc[-3]) & 0xff000000) .
7743 Generate code for the 16-bit Thumb instruction set.
7744 The default is to use the 32-bit ARM instruction set.
7747 Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all non-leaf functions.
7748 (A leaf function is one that does not call any other functions.) The default is
7749 .Fl mno-tpcs-frame .
7751 .It Fl mtpcs-leaf-frame
7752 Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all leaf functions.
7753 (A leaf function is one that does not call any other functions.) The default is
7754 .Fl mno-apcs-leaf-frame .
7756 .It Fl mcallee-super-interworking
7757 Gives all externally visible functions in the file being compiled an ARM instruction set header which switches to Thumb mode before executing the rest of the function.
7758 This allows these functions to be called from non-interworking code.
7760 .It Fl mcaller-super-interworking
7761 Allows calls via function pointers (including virtual functions) to execute correctly regardless of whether the target code has been compiled for interworking or not.
7762 There is a small overhead in the cost of executing a function pointer if this option is enabled.
7764 .It Fl mtp= Ns Ar name
7765 Specify the access model for the thread local storage pointer.
7766 The valid models are
7768 which generates calls to
7769 .Va __aeabi_read_tp ,
7771 which fetches the thread pointer from
7773 directly (supported in the arm6k architecture), and
7775 which uses the best available method for the selected processor.
7776 The default setting is
7781 These options are defined for AVR implementations:
7784 .It Fl mmcu= Ns Ar mcu
7785 Specify ATMEL AVR instruction set or MCU type.
7787 Instruction set avr1 is for the minimal AVR core, not supported by the C compiler, only for assembler programs (MCU types: at90s1200, attiny10, attiny11, attiny12, attiny15, attiny28).
7789 Instruction set avr2 (default) is for the classic AVR core with up to 8K program memory space (MCU types: at90s2313, at90s2323, attiny22, at90s2333, at90s2343, at90s4414, at90s4433, at90s4434, at90s8515, at90c8534, at90s8535).
7791 Instruction set avr3 is for the classic AVR core with up to 128K program memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7793 Instruction set avr4 is for the enhanced AVR core with up to 8K program memory space (MCU types: atmega8, atmega83, atmega85).
7795 Instruction set avr5 is for the enhanced AVR core with up to 128K program memory space (MCU types: atmega16, atmega161, atmega163, atmega32, atmega323, atmega64, atmega128, at43usb355, at94k).
7798 Output instruction sizes to the asm file.
7800 .It Fl minit-stack= Ns Ar N
7801 Specify the initial stack address, which may be a symbol or numeric value,
7805 .It Fl mno-interrupts
7806 Generated code is not compatible with hardware interrupts.
7807 Code size will be smaller.
7809 .It Fl mcall-prologues
7810 Functions prologues/epilogues expanded as call to appropriate subroutines.
7811 Code size will be smaller.
7813 .It Fl mno-tablejump
7814 Do not generate tablejump insns which sometimes increase code size.
7817 Change only the low 8 bits of the stack pointer.
7820 Assume int to be 8 bit integer.
7821 This affects the sizes of all types: A char will be 1 byte, an int will be 1 byte, an long will be 2 bytes and long long will be 4 bytes.
7822 Please note that this option does not comply to the C standards, but it will provide you with smaller code size.
7825 .It Sy Blackfin Options
7827 .It Fl momit-leaf-frame-pointer
7828 Don't keep the frame pointer in a register for leaf functions.
7829 This avoids the instructions to save, set up and restore frame pointers and makes an extra register available in leaf functions.
7831 .Fl fomit-frame-pointer
7832 removes the frame pointer for all functions which might make debugging harder.
7834 .It Fl mspecld-anomaly
7835 When enabled, the compiler will ensure that the generated code does not contain speculative loads after jump instructions.
7836 This option is enabled by default.
7838 .It Fl mno-specld-anomaly
7839 Don't generate extra code to prevent speculative loads from occurring.
7841 .It Fl mcsync-anomaly
7842 When enabled, the compiler will ensure that the generated code does not contain CSYNC or SSYNC instructions too soon after conditional branches.
7843 This option is enabled by default.
7845 .It Fl mno-csync-anomaly
7846 Don't generate extra code to prevent CSYNC or SSYNC instructions from occurring too soon after a conditional branch.
7849 When enabled, the compiler is free to take advantage of the knowledge that the entire program fits into the low 64k of memory.
7852 Assume that the program is arbitrarily large.
7853 This is the default.
7855 .It Fl mid-shared-library
7856 Generate code that supports shared libraries via the library ID method.
7857 This allows for execute in place and shared libraries in an environment without virtual memory management.
7861 .It Fl mno-id-shared-library
7862 Generate code that doesn't assume ID based shared libraries are being used.
7863 This is the default.
7865 .It Fl mshared-library-id=n
7866 Specified the identification number of the ID based shared library being compiled.
7867 Specifying a value of 0 will generate more compact code, specifying other values will force the allocation of that number to the current library but is no more space or time efficient than omitting this option.
7870 .It Fl mno-long-calls
7871 Tells the compiler to perform function calls by first loading the address of the function into a register and then performing a subroutine call on this register.
7872 This switch is needed if the target function will lie outside of the 24 bit addressing range of the offset based version of subroutine call instruction.
7874 This feature is not enabled by default.
7877 will restore the default behavior.
7878 Note these switches have no effect on how the compiler generates code to handle function calls via function pointers.
7882 These options are defined specifically for the CRIS ports.
7885 .It Fl march= Ns Ar architecture-type
7886 .It Fl mcpu= Ns Ar architecture-type
7887 Generate code for the specified architecture.
7889 .Em architecture-type
7895 for respectively ETRAX\~4, ETRAX\~100, and ETRAX\~100\~LX.
7898 except for cris-axis-linux-gnu, where the default is
7901 .It Fl mtune= Ns Ar architecture-type
7903 .Em architecture-type
7904 everything applicable about the generated code, except for the ABI and the set of available instructions.
7906 .Em architecture-type
7908 .Fl march= Ns Ar architecture-type .
7910 .It Fl mmax-stack-frame= Ns Ar n
7911 Warn when the stack frame of a function exceeds
7915 .It Fl melinux-stacksize= Ns Ar n
7916 Only available with the
7919 Arranges for indications in the program to the kernel loader that the stack of the program should be set to
7935 .It Fl mmul-bug-workaround
7936 .It Fl mno-mul-bug-workaround
7937 Work around a bug in the
7941 instructions for CPU models where it applies.
7942 This option is active by default.
7945 Enable CRIS-specific verbose debug-related information in the assembly code.
7946 This option also has the effect to turn off the
7948 formatted-code indicator to the assembler at the beginning of the assembly file.
7951 Do not use condition-code results from previous instruction; always emit compare and test instructions before use of condition codes.
7953 .It Fl mno-side-effects
7954 Do not emit instructions with side-effects in addressing modes other than post-increment.
7957 .It Fl mno-stack-align
7959 .It Fl mno-data-align
7961 .It Fl mno-const-align
7962 These options (no-options) arranges (eliminate arrangements) for the stack-frame, individual data and constants to be aligned for the maximum single data access size for the chosen CPU model.
7963 The default is to arrange for 32-bit alignment.
7964 ABI details such as structure layout are not affected by these options.
7969 Similar to the stack- data- and const-align options above, these options arrange for stack-frame, writable data and constants to all be 32-bit, 16-bit or 8-bit aligned.
7970 The default is 32-bit alignment.
7972 .It Fl mno-prologue-epilogue
7973 .It Fl mprologue-epilogue
7975 .Fl mno-prologue-epilogue ,
7976 the normal function prologue and epilogue that sets up the stack-frame are omitted and no return instructions or return sequences are generated in the code.
7977 Use this option only together with visual inspection of the compiled code: no warnings or errors are generated when call-saved registers must be saved, or storage for local variable needs to be allocated.
7985 don't generate (do generate) instruction sequences that load addresses for functions from the PLT part of the GOT rather than (traditional on other architectures) calls to the PLT.
7990 Legacy no-op option only recognized with the cris-axis-aout target.
7993 Legacy no-op option only recognized with the cris-axis-elf and cris-axis-linux-gnu targets.
7996 Only recognized with the cris-axis-aout target, where it selects a GNU/linux-like multilib, include files and instruction set for
8000 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8003 This option, recognized for the cris-axis-aout and cris-axis-elf arranges to link with input-output functions from a simulator library.
8004 Code, initialized data and zero-initialized data are allocated consecutively.
8009 but pass linker options to locate initialized data at 0x40000000 and zero-initialized data at 0x80000000.
8013 These options are defined specifically for the CRX ports.
8017 Enable the use of multiply-accumulate instructions.
8018 Disabled by default.
8021 Push instructions will be used to pass outgoing arguments when functions are called.
8025 .It Sy Darwin Options
8026 These options are defined for all architectures running the Darwin operating system.
8028 FSF GCC on Darwin does not create "fat" object files; it will create an object file for the single architecture that it was built to target.
8029 Apple's GCC on Darwin does create "fat" files if multiple
8031 options are used; it does so by running the compiler or linker multiple times and joining the results together with
8034 The subtype of the file created (like
8040 is determined by the flags that specify the ISA that GCC is targetting, like
8045 .Fl force_cpusubtype_ALL
8046 option can be used to override this.
8048 The Darwin tools vary in their behavior when presented with an ISA mismatch.
8051 will only permit instructions to be used that are valid for the subtype of the file it is generating, so you cannot put 64-bit instructions in an
8054 The linker for shared libraries,
8055 .Pa /usr/bin/libtool ,
8056 will fail and print an error if asked to create a shared library with a less restrictive subtype than its input files (for instance, trying to put a
8061 The linker for executables,
8063 will quietly give the executable the most restrictive subtype of any of its input files.
8067 Add the framework directory
8069 to the head of the list of directories to be searched for header files.
8070 These directories are interleaved with those specified by
8072 options and are scanned in a left-to-right order.
8074 A framework directory is a directory with frameworks in it.
8075 A framework is a directory with a
8078 .Sy \&"PrivateHeaders"
8079 directory contained directly in it that ends in
8080 .Sy \&".framework" .
8081 The name of a framework is the name of this directory excluding the
8082 .Sy \&".framework" .
8083 Headers associated with the framework are found in one of those two directories, with
8085 being searched first.
8086 A subframework is a framework directory that is in a framework's
8089 Includes of subframework headers can only appear in a header of a framework that contains the subframework, or in a sibling subframework header.
8090 Two subframeworks are siblings if they occur in the same framework.
8091 A subframework should not have the same name as a framework, a warning will be issued if this is violated.
8092 Currently a subframework cannot have subframeworks, in the future, the mechanism may be extended to support this.
8093 The standard frameworks can be found in
8094 .Sy \&"/System/Library/Frameworks"
8096 .Sy \&"/Library/Frameworks" .
8097 An example include looks like
8098 .Va #include \*[Lt]Framework/header.h\*[Gt] ,
8101 denotes the name of the framework and header.h is found in the
8102 .Sy \&"PrivateHeaders"
8108 Emit debugging information for symbols that are used.
8109 For STABS debugging format, this enables
8110 .Fl feliminate-unused-debug-symbols .
8111 This is by default ON.
8114 Emit debugging information for all symbols and types.
8116 .It Fl mmacosx-version-min= Ns Ar version
8117 The earliest version of MacOS X that this executable will run on is
8127 The default for this option is to make choices that seem to be most useful.
8129 .It Fl mone-byte-bool
8130 Override the defaults for
8133 .Sy sizeof(bool)==1 .
8138 when compiling for Darwin/PowerPC and
8140 when compiling for Darwin/x86, so this option has no effect on x86.
8145 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
8146 Using this switch may require recompiling all other modules in a program, including system libraries.
8147 Use this switch to conform to a non-default data model.
8149 .It Fl mfix-and-continue
8150 .It Fl ffix-and-continue
8151 .It Fl findirect-data
8152 Generate code suitable for fast turn around development.
8153 Needed to enable gdb to dynamically load
8155 files into already running programs.
8158 .Fl ffix-and-continue
8159 are provided for backwards compatibility.
8162 Loads all members of static archive libraries.
8163 See man ld(1) for more information.
8165 .It Fl arch_errors_fatal
8166 Cause the errors having to do with files that have the wrong architecture to be fatal.
8169 Causes the output file to be marked such that the dynamic linker will bind all undefined references when the file is loaded or launched.
8172 Produce a Mach-o bundle format file.
8173 See man ld(1) for more information.
8175 .It Fl bundle_loader Ar executable
8176 This option specifies the
8178 that will be loading the build output file being linked.
8179 See man ld(1) for more information.
8182 When passed this option, GCC will produce a dynamic library instead of an executable when linking, using the Darwin
8186 .It Fl force_cpusubtype_ALL
8187 This causes GCC's output file to have the
8189 subtype, instead of one controlled by the
8195 .It Fl allowable_client Ar client_name
8197 .It Fl compatibility_version
8198 .It Fl current_version
8200 .It Fl dependency-file
8202 .It Fl dylinker_install_name
8204 .It Fl exported_symbols_list
8206 .It Fl flat_namespace
8207 .It Fl force_flat_namespace
8208 .It Fl headerpad_max_install_names
8212 .It Fl keep_private_externs
8214 .It Fl multiply_defined
8215 .It Fl multiply_defined_unused
8217 .It Fl no_dead_strip_inits_and_terms
8218 .It Fl nofixprebinding
8221 .It Fl noseglinkedit
8222 .It Fl pagezero_size
8224 .It Fl prebind_all_twolevel_modules
8225 .It Fl private_bundle
8226 .It Fl read_only_relocs
8228 .It Fl sectobjectsymbols
8232 .It Fl sectobjectsymbols
8235 .It Fl segs_read_only_addr
8236 .It Fl segs_read_write_addr
8237 .It Fl seg_addr_table
8238 .It Fl seg_addr_table_filename
8241 .It Fl segs_read_only_addr
8242 .It Fl segs_read_write_addr
8243 .It Fl single_module
8247 .It Fl twolevel_namespace
8250 .It Fl unexported_symbols_list
8251 .It Fl weak_reference_mismatches
8253 These options are passed to the Darwin linker.
8254 The Darwin linker man page describes them in detail.
8257 .It Sy DEC Alpha Options
8260 options are defined for the DEC Alpha implementations:
8263 .It Fl mno-soft-float
8265 Use (do not use) the hardware floating-point instructions for floating-point operations.
8268 is specified, functions in
8270 will be used to perform floating-point operations.
8271 Unless they are replaced by routines that emulate the floating-point operations, or compiled in such a way as to call such emulations routines, these routines will issue floating-point operations.
8272 If you are compiling for an Alpha without floating-point operations, you must ensure that the library is built so as not to call them.
8274 Note that Alpha implementations without floating-point operations are required to have floating-point registers.
8278 Generate code that uses (does not use) the floating-point register set.
8282 If the floating-point register set is not used, floating point operands are passed in integer registers as if they were integers and floating-point results are passed in
8286 This is a non-standard calling sequence, so any function with a floating-point argument or return value called by code compiled with
8288 must also be compiled with that option.
8290 A typical use of this option is building a kernel that does not use, and hence need not save and restore, any floating-point registers.
8293 The Alpha architecture implements floating-point hardware optimized for maximum performance.
8294 It is mostly compliant with the IEEE floating point standard.
8295 However, for full compliance, software assistance is required.
8296 This option generates code fully IEEE compliant code
8300 is not maintained (see below).
8301 If this option is turned on, the preprocessor macro
8303 is defined during compilation.
8304 The resulting code is less efficient but is able to correctly support denormalized numbers and exceptional IEEE values such as not-a-number and plus/minus infinity.
8305 Other Alpha compilers call this option
8306 .Fl ieee_with_no_inexact .
8308 .It Fl mieee-with-inexact
8311 except the generated code also maintains the IEEE
8313 Turning on this option causes the generated code to implement fully-compliant IEEE math.
8317 is defined as a preprocessor macro.
8318 On some Alpha implementations the resulting code may execute significantly slower than the code generated by default.
8319 Since there is very little code that depends on the
8321 you should normally not specify this option.
8322 Other Alpha compilers call this option
8323 .Fl ieee_with_inexact .
8325 .It Fl mfp-trap-mode= Ns Ar trap-mode
8326 This option controls what floating-point related traps are enabled.
8327 Other Alpha compilers call this option
8328 .Fl fptm Ar trap-mode .
8329 The trap mode can be set to one of four values:
8333 This is the default (normal) setting.
8334 The only traps that are enabled are the ones that cannot be disabled in software (e.g., division by zero trap).
8337 In addition to the traps enabled by
8339 underflow traps are enabled as well.
8344 but the instructions are marked to be safe for software completion (see Alpha architecture manual for details).
8349 but inexact traps are enabled as well.
8352 .It Fl mfp-rounding-mode= Ns Ar rounding-mode
8353 Selects the IEEE rounding mode.
8354 Other Alpha compilers call this option
8355 .Fl fprm Ar rounding-mode .
8362 Normal IEEE rounding mode.
8363 Floating point numbers are rounded towards the nearest machine number or towards the even machine number in case of a tie.
8366 Round towards minus infinity.
8369 Chopped rounding mode.
8370 Floating point numbers are rounded towards zero.
8373 Dynamic rounding mode.
8374 A field in the floating point control register
8376 see Alpha architecture reference manual) controls the rounding mode in effect.
8377 The C library initializes this register for rounding towards plus infinity.
8378 Thus, unless your program modifies the
8381 corresponds to round towards plus infinity.
8384 .It Fl mtrap-precision= Ns Ar trap-precision
8385 In the Alpha architecture, floating point traps are imprecise.
8386 This means without software assistance it is impossible to recover from a floating trap and program execution normally needs to be terminated.
8387 GCC can generate code that can assist operating system trap handlers in determining the exact location that caused a floating point trap.
8388 Depending on the requirements of an application, different levels of precisions can be selected:
8393 This option is the default and means a trap handler can only identify which program caused a floating point exception.
8397 The trap handler can determine the function that caused a floating point exception.
8400 Instruction precision.
8401 The trap handler can determine the exact instruction that caused a floating point exception.
8404 Other Alpha compilers provide the equivalent options called
8407 .Fl resumption_safe .
8409 .It Fl mieee-conformant
8410 This option marks the generated code as IEEE conformant.
8411 You must not use this option unless you also specify
8412 .Fl mtrap-precision=i
8414 .Fl mfp-trap-mode=su
8416 .Fl mfp-trap-mode=sui .
8417 Its only effect is to emit the line
8419 in the function prologue of the generated assembly file.
8420 Under DEC Unix, this has the effect that IEEE-conformant math library routines will be linked in.
8422 .It Fl mbuild-constants
8423 Normally GCC examines a 32- or 64-bit integer constant to see if it can construct it from smaller constants in two or three instructions.
8424 If it cannot, it will output the constant as a literal and generate code to load it from the data segment at runtime.
8426 Use this option to require GCC to construct
8428 integer constants using code, even if it takes more instructions (the maximum is six).
8430 You would typically use this option to build a shared library dynamic loader.
8431 Itself a shared library, it must relocate itself in memory before it can find the variables and constants in its own data segment.
8435 Select whether to generate code to be assembled by the vendor-supplied assembler
8437 or by the GNU assembler
8448 Indicate whether GCC should generate code to use the optional BWX, CIX, FIX and MAX instruction sets.
8449 The default is to use the instruction sets supported by the CPU type specified via
8451 option or that of the CPU on which GCC was built if none was specified.
8455 Generate code that uses (does not use) VAX F and G floating point arithmetic instead of IEEE single and double precision.
8457 .It Fl mexplicit-relocs
8458 .It Fl mno-explicit-relocs
8459 Older Alpha assemblers provided no way to generate symbol relocations except via assembler macros.
8460 Use of these macros does not allow optimal instruction scheduling.
8461 GNU binutils as of version 2.12 supports a new syntax that allows the compiler to explicitly mark which relocations should apply to which instructions.
8462 This option is mostly useful for debugging, as GCC detects the capabilities of the assembler when it is built and sets the default accordingly.
8467 .Fl mexplicit-relocs
8468 is in effect, static data is accessed via
8473 is used, objects 8 bytes long or smaller are placed in a
8479 sections) and are accessed via 16-bit relocations off of the
8482 This limits the size of the small data area to 64KB, but allows the variables to be directly accessed via a single instruction.
8486 With this option the data area is limited to just below 2GB.
8487 Programs that require more than 2GB of data must use
8491 to allocate the data in the heap instead of in the program's data segment.
8493 When generating code for shared libraries,
8506 is used, the compiler assumes that the code of the entire program (or shared library) fits in 4MB, and is thus reachable with a branch instruction.
8509 is used, the compiler can assume that all local symbols share the same
8511 value, and thus reduce the number of instructions required for a function call from 4 to 1.
8516 .It Fl mcpu= Ns Ar cpu_type
8517 Set the instruction set and instruction scheduling parameters for machine type
8519 You can specify either the
8521 style name or the corresponding chip number.
8522 GCC supports scheduling parameters for the EV4, EV5 and EV6 family of processors and will choose the default values for the instruction set from the processor you specify.
8523 If you do not specify a processor type, GCC will default to the processor on which the compiler was built.
8525 Supported values for
8533 Schedules as an EV4 and has no instruction set extensions.
8537 Schedules as an EV5 and has no instruction set extensions.
8541 Schedules as an EV5 and supports the BWX extension.
8546 Schedules as an EV5 and supports the BWX and MAX extensions.
8550 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8554 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8557 .It Fl mtune= Ns Ar cpu_type
8558 Set only the instruction scheduling parameters for machine type
8560 The instruction set is not changed.
8562 .It Fl mmemory-latency= Ns Ar time
8563 Sets the latency the scheduler should assume for typical memory references as seen by the application.
8564 This number is highly dependent on the memory access patterns used by the application and the size of the external cache on the machine.
8572 A decimal number representing clock cycles.
8578 The compiler contains estimates of the number of clock cycles for "typical" EV4 & EV5 hardware for the Level 1, 2 & 3 caches (also called Dcache, Scache, and Bcache), as well as to main memory.
8579 Note that L3 is only valid for EV5.
8583 .It Sy DEC Alpha/VMS Options
8586 options are defined for the DEC Alpha/VMS implementations:
8589 .It Fl mvms-return-codes
8590 Return VMS condition codes from main.
8591 The default is to return POSIX style condition (e.g. error) codes.
8597 Only use the first 32 general purpose registers.
8600 Use all 64 general purpose registers.
8603 Use only the first 32 floating point registers.
8606 Use all 64 floating point registers
8609 Use hardware instructions for floating point operations.
8612 Use library routines for floating point operations.
8615 Dynamically allocate condition code registers.
8618 Do not try to dynamically allocate condition code registers, only use
8624 Change ABI to use double word insns.
8627 Do not use double word instructions.
8630 Use floating point double instructions.
8633 Do not use floating point double instructions.
8636 Use media instructions.
8639 Do not use media instructions.
8642 Use multiply and add/subtract instructions.
8645 Do not use multiply and add/subtract instructions.
8648 Select the FDPIC ABI, that uses function descriptors to represent pointers to functions.
8649 Without any PIC/PIE-related options, it implies
8655 it assumes GOT entries and small data are within a 12-bit range from the GOT base address; with
8659 GOT offsets are computed with 32 bits.
8662 Enable inlining of PLT entries in function calls to functions that are not known to bind locally.
8663 It has no effect without
8665 It's enabled by default if optimizing for speed and compiling for shared libraries (i.e.,
8669 or when an optimization option such as
8671 or above is present in the command line.
8674 Assume a large TLS segment when generating thread-local code.
8677 Do not assume a large TLS segment when generating thread-local code.
8682 relocations in the FDPIC ABI for data that is known to be in read-only sections.
8683 It's enabled by default, except for
8687 even though it may help make the global offset table smaller, it trades 1 instruction for 4.
8692 it trades 3 instructions for 4, one of which may be shared by multiple symbols, and it avoids the need for a GOT entry for the referenced symbol, so it's more likely to be a win.
8695 can be used to disable it.
8697 .It Fl multilib-library-pic
8698 Link with the (library, not FD) pic libraries.
8707 You should never have to use it explicitly.
8710 Follow the EABI requirement of always creating a frame pointer whenever a stack frame is allocated.
8711 This option is enabled by default and can be disabled with
8715 Use indirect addressing to call functions outside the current compilation unit.
8716 This allows the functions to be placed anywhere within the 32-bit address space.
8718 .It Fl malign-labels
8719 Try to align labels to an 8-byte boundary by inserting nops into the previous packet.
8720 This option only has an effect when VLIW packing is enabled.
8721 It doesn't create new packets; it merely adds nops to existing ones.
8724 Generate position-independent EABI code.
8727 Use only the first four media accumulator registers.
8730 Use all eight media accumulator registers.
8733 Pack VLIW instructions.
8736 Do not pack VLIW instructions.
8739 Do not mark ABI switches in e_flags.
8742 Enable the use of conditional-move instructions (default).
8744 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8746 .It Fl mno-cond-move
8747 Disable the use of conditional-move instructions.
8749 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8752 Enable the use of conditional set instructions (default).
8754 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8757 Disable the use of conditional set instructions.
8759 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8762 Enable the use of conditional execution (default).
8764 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8766 .It Fl mno-cond-exec
8767 Disable the use of conditional execution.
8769 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8772 Run a pass to pack branches into VLIW instructions (default).
8774 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8776 .It Fl mno-vliw-branch
8777 Do not run a pass to pack branches into VLIW instructions.
8779 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8781 .It Fl mmulti-cond-exec
8782 Enable optimization of
8786 in conditional execution (default).
8788 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8790 .It Fl mno-multi-cond-exec
8791 Disable optimization of
8795 in conditional execution.
8797 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8799 .It Fl mnested-cond-exec
8800 Enable nested conditional execution optimizations (default).
8802 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8804 .It Fl mno-nested-cond-exec
8805 Disable nested conditional execution optimizations.
8807 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8809 .It Fl moptimize-membar
8810 This switch removes redundant
8812 instructions from the compiler generated code.
8813 It is enabled by default.
8815 .It Fl mno-optimize-membar
8816 This switch disables the automatic removal of redundant
8818 instructions from the generated code.
8820 .It Fl mtomcat-stats
8821 Cause gas to print out tomcat statistics.
8823 .It Fl mcpu= Ns Ar cpu
8824 Select the processor type for which to generate code.
8838 .It Sy H8/300 Options
8841 options are defined for the H8/300 implementations:
8845 Shorten some address references at link time, when possible; uses the linker option
8849 Generate code for the H8/300H.
8852 Generate code for the H8S.
8855 Generate code for the H8S and H8/300H in the normal mode.
8856 This switch must be used either with
8862 Generate code for the H8S/2600.
8863 This switch must be used with
8869 data 32 bits by default.
8872 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
8873 The default for the H8/300H and H8S is to align longs and floats on 4 byte boundaries.
8875 causes them to be aligned on 2 byte boundaries.
8876 This option has no effect on the H8/300.
8882 options are defined for the HPPA family of computers:
8885 .It Fl march= Ns Ar architecture-type
8886 Generate code for the specified architecture.
8888 .Em architecture-type
8895 for PA 2.0 processors.
8897 .Pa /usr/lib/sched.models
8898 on an HP-UX system to determine the proper architecture option for your machine.
8899 Code compiled for lower numbered architectures will run on higher numbered architectures, but not the other way around.
8912 Generate code suitable for big switch tables.
8913 Use this option only if the assembler/linker complain about out of range branches within a switch table.
8915 .It Fl mjump-in-delay
8916 Fill delay slots of function calls with unconditional jump instructions by modifying the return pointer for the function call to be the target of the conditional jump.
8918 .It Fl mdisable-fpregs
8919 Prevent floating point registers from being used in any manner.
8920 This is necessary for compiling kernels which perform lazy context switching of floating point registers.
8921 If you use this option and attempt to perform floating point operations, the compiler will abort.
8923 .It Fl mdisable-indexing
8924 Prevent the compiler from using indexing address modes.
8925 This avoids some rather obscure problems when compiling MIG generated code under MACH.
8927 .It Fl mno-space-regs
8928 Generate code that assumes the target has no space registers.
8929 This allows GCC to generate faster indirect calls and use unscaled index address modes.
8931 Such code is suitable for level 0 PA systems and kernels.
8933 .It Fl mfast-indirect-calls
8934 Generate code that assumes calls never cross space boundaries.
8935 This allows GCC to emit code which performs faster indirect calls.
8937 This option will not work in the presence of shared libraries or nested functions.
8939 .It Fl mfixed-range= Ns Ar register-range
8940 Generate code treating the given register range as fixed registers.
8941 A fixed register is one that the register allocator can not use.
8942 This is useful when compiling kernel code.
8943 A register range is specified as two registers separated by a dash.
8944 Multiple register ranges can be specified separated by a comma.
8946 .It Fl mlong-load-store
8947 Generate 3-instruction load and store sequences as sometimes required by the HP-UX 10 linker.
8948 This is equivalent to the
8950 option to the HP compilers.
8952 .It Fl mportable-runtime
8953 Use the portable calling conventions proposed by HP for ELF systems.
8956 Enable the use of assembler directives only GAS understands.
8958 .It Fl mschedule= Ns Ar cpu-type
8959 Schedule code according to the constraints for the machine type
8972 .Pa /usr/lib/sched.models
8973 on an HP-UX system to determine the proper scheduling option for your machine.
8974 The default scheduling is
8978 Enable the optimization pass in the HP-UX linker.
8979 Note this makes symbolic debugging impossible.
8980 It also triggers a bug in the HP-UX 8 and HP-UX 9 linkers in which they give bogus error messages when linking some programs.
8983 Generate output containing library calls for floating point.
8985 the requisite libraries are not available for all HPPA targets.
8986 Normally the facilities of the machine's usual C compiler are used, but this cannot be done directly in cross-compilation.
8987 You must make your own arrangements to provide suitable library functions for cross-compilation.
8990 does provide software floating point support.
8993 changes the calling convention in the output file; therefore, it is only useful if you compile
8995 of a program with this option.
8996 In particular, you need to compile
8998 the library that comes with GCC, with
9000 in order for this to work.
9003 Generate the predefine,
9008 This generates the predefines,
9014 These options are available under HP-UX and HI-UX.
9017 Use GNU ld specific options.
9020 to ld when building a shared library.
9021 It is the default when GCC is configured, explicitly or implicitly, with the GNU linker.
9022 This option does not have any affect on which ld is called, it only changes what parameters are passed to that ld.
9023 The ld that is called is determined by the
9025 configure option, GCC's program search path, and finally by the user's
9027 The linker used by GCC can be printed using
9028 .Sy which `gcc -print-prog-name=ld` .
9029 This option is only available on the 64 bit HP-UX GCC, i.e. configured with
9030 .Sy hppa*64*-*-hpux* .
9033 Use HP ld specific options.
9036 to ld when building a shared library and passes
9037 .Sy +Accept TypeMismatch
9039 It is the default when GCC is configured, explicitly or implicitly, with the HP linker.
9040 This option does not have any affect on which ld is called, it only changes what parameters are passed to that ld.
9041 The ld that is called is determined by the
9043 configure option, GCC's program search path, and finally by the user's
9045 The linker used by GCC can be printed using
9046 .Sy which `gcc -print-prog-name=ld` .
9047 This option is only available on the 64 bit HP-UX GCC, i.e. configured with
9048 .Sy hppa*64*-*-hpux* .
9051 Generate code that uses long call sequences.
9052 This ensures that a call is always able to reach linker generated stubs.
9053 The default is to generate long calls only when the distance from the call site to the beginning of the function or translation unit, as the case may be, exceeds a predefined limit set by the branch type being used.
9054 The limits for normal calls are 7,600,000 and 240,000 bytes, respectively for the PA 2.0 and PA 1.X architectures.
9055 Sibcalls are always limited at 240,000 bytes.
9057 Distances are measured from the beginning of functions when using the
9058 .Fl ffunction-sections
9059 option, or when using the
9062 .Fl mno-portable-runtime
9063 options together under HP-UX with the SOM linker.
9065 It is normally not desirable to use this option as it will degrade performance.
9066 However, it may be useful in large applications, particularly when partial linking is used to build the application.
9068 The types of long calls used depends on the capabilities of the assembler and linker, and the type of code being generated.
9069 The impact on systems that support long absolute calls, and long pic symbol-difference or pc-relative calls should be relatively small.
9070 However, an indirect call is used on 32-bit ELF systems in pic code and it is quite long.
9072 .It Fl munix= Ns Ar unix-std
9073 Generate compiler predefines and select a startfile for the specified UNIX standard.
9082 is supported on all HP-UX versions.
9084 is available on HP-UX 10.10 and later.
9086 is available on HP-UX 11.11 and later.
9087 The default values are
9091 for HP-UX 10.10 though to 11.00, and
9093 for HP-UX 11.11 and later.
9096 provides the same predefines as GCC 3.3 and 3.4.
9098 provides additional predefines for
9101 .Va _XOPEN_SOURCE_EXTENDED ,
9105 provides additional predefines for
9107 .Va _XOPEN_SOURCE_EXTENDED ,
9108 .Va _INCLUDE__STDC_A1_SOURCE
9110 .Va _INCLUDE_XOPEN_SOURCE_500 ,
9116 to note that this option changes the interfaces for various library routines.
9117 It also affects the operational behavior of the C library.
9120 care is needed in using this option.
9122 Library code that is intended to operate with more than one UNIX standard must test, set and restore the variable
9123 .Em __xpg4_extended_mask
9125 Most GNU software doesn't provide this capability.
9128 Suppress the generation of link options to search libdld.sl when the
9130 option is specified on HP-UX 10 and later.
9133 The HP-UX implementation of setlocale in libc has a dependency on libdld.sl.
9134 There isn't an archive version of libdld.sl.
9137 option is specified, special link options are needed to resolve this dependency.
9139 On HP-UX 10 and later, the GCC driver adds the necessary options to link with libdld.sl when the
9141 option is specified.
9142 This causes the resulting binary to be dynamic.
9143 On the 64-bit port, the linkers generate dynamic binaries by default in any case.
9146 option can be used to prevent the GCC driver from adding these link options.
9149 Add support for multithreading with the
9151 library under HP-UX.
9152 This option sets flags for both the preprocessor and linker.
9155 .It Sy Intel 386 and AMD x86-64 Options
9158 options are defined for the i386 and x86-64 family of computers:
9161 .It Fl mtune= Ns Ar cpu-type
9164 everything applicable about the generated code, except for the ABI and the set of available instructions.
9171 Original Intel's i386 CPU.
9175 (No scheduling is implemented for this chip.)
9177 .It Sy i586, pentium
9178 Intel Pentium CPU with no MMX support.
9181 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9183 .It Sy i686, pentiumpro
9184 Intel PentiumPro CPU.
9187 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9189 .It Sy pentium3, pentium3m
9190 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set support.
9193 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set support.
9194 Used by Centrino notebooks.
9196 .It Sy pentium4, pentium4m
9197 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9200 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
9203 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 instruction set support.
9206 AMD K6 CPU with MMX instruction set support.
9209 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9211 .It Sy athlon, athlon-tbird
9212 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions support.
9214 .It Sy athlon-4, athlon-xp, athlon-mp
9215 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE instruction set support.
9217 .It Sy k8, opteron, athlon64, athlon-fx
9218 AMD K8 core based CPUs with x86-64 instruction set support.
9219 (This supersets MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9222 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction set support.
9225 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW! instruction set support.
9228 Via C3 CPU with MMX and 3dNOW! instruction set support.
9229 (No scheduling is implemented for this chip.)
9232 Via C3-2 CPU with MMX and SSE instruction set support.
9233 (No scheduling is implemented for this chip.)
9236 While picking a specific
9238 will schedule things appropriately for that particular chip, the compiler will not generate any code that does not run on the i386 without the
9239 .Fl march= Ns Ar cpu-type
9242 .It Fl march= Ns Ar cpu-type
9243 Generate instructions for the machine type
9249 Moreover, specifying
9250 .Fl march= Ns Ar cpu-type
9252 .Fl mtune= Ns Ar cpu-type .
9254 .It Fl mcpu= Ns Ar cpu-type
9255 A deprecated synonym for
9262 These options are synonyms for
9267 .Fl mtune=pentiumpro
9269 These synonyms are deprecated.
9271 .It Fl mfpmath= Ns Ar unit
9272 Generate floating point arithmetics for selected unit
9280 Use the standard 387 floating point coprocessor present majority of chips and emulated otherwise.
9281 Code compiled with this option will run almost everywhere.
9282 The temporary results are computed in 80bit precision instead of precision specified by the type resulting in slightly different results compared to most of other chips.
9285 for more detailed description.
9287 This is the default choice for i386 compiler.
9290 Use scalar floating point instructions present in the SSE instruction set.
9291 This instruction set is supported by Pentium3 and newer chips, in the AMD line by Athlon-4, Athlon-xp and Athlon-mp chips.
9292 The earlier version of SSE instruction set supports only single precision arithmetics, thus the double and extended precision arithmetics is still done using 387.
9293 Later version, present only in Pentium4 and the future AMD x86-64 chips supports double precision arithmetics too.
9295 For the i386 compiler, you need to use
9296 .Fl march= Ns Ar cpu-type ,
9300 switches to enable SSE extensions and make this option effective.
9301 For the x86-64 compiler, these extensions are enabled by default.
9303 The resulting code should be considerably faster in the majority of cases and avoid the numerical instability problems of 387 code, but may break some existing code that expects temporaries to be 80bit.
9305 This is the default choice for the x86-64 compiler.
9308 Attempt to utilize both instruction sets at once.
9309 This effectively double the amount of available registers and on chips with separate execution units for 387 and SSE the execution resources too.
9310 Use this option with care, as it is still experimental, because the GCC register allocator does not model separate functional units well resulting in instable performance.
9313 .It Fl masm= Ns Ar dialect
9314 Output asm instructions using selected
9316 Supported choices are
9321 Darwin does not support
9326 Control whether or not the compiler uses IEEE floating point comparisons.
9327 These handle correctly the case where the result of a comparison is unordered.
9330 Generate output containing library calls for floating point.
9332 the requisite libraries are not part of GCC.
9333 Normally the facilities of the machine's usual C compiler are used, but this can't be done directly in cross-compilation.
9334 You must make your own arrangements to provide suitable library functions for cross-compilation.
9336 On machines where a function returns floating point results in the 80387 register stack, some floating point opcodes may be emitted even if
9340 .It Fl mno-fp-ret-in-387
9341 Do not use the FPU registers for return values of functions.
9343 The usual calling convention has functions return values of types
9347 in an FPU register, even if there is no FPU.
9348 The idea is that the operating system should emulate an FPU.
9351 .Fl mno-fp-ret-in-387
9352 causes such values to be returned in ordinary CPU registers instead.
9354 .It Fl mno-fancy-math-387
9355 Some 387 emulators do not support the
9360 instructions for the 387.
9361 Specify this option to avoid generating those instructions.
9362 This option is the default on FreeBSD, OpenBSD and NetBSD.
9363 This option is overridden when
9365 indicates that the target cpu will always have an FPU and so the instruction will not need emulation.
9366 As of revision 2.6.1, these instructions are not generated unless you also use the
9367 .Fl funsafe-math-optimizations
9370 .It Fl malign-double
9371 .It Fl mno-align-double
9372 Control whether GCC aligns
9377 variables on a two word boundary or a one word boundary.
9380 variables on a two word boundary will produce code that runs somewhat faster on a
9382 at the expense of more memory.
9386 is enabled by default.
9391 switch, structures containing the above types will be aligned differently than the published application binary interface specifications for the 386 and will not be binary compatible with structures in code compiled without that switch.
9393 .It Fl m96bit-long-double
9394 .It Fl m128bit-long-double
9395 These switches control the size of
9398 The i386 application binary interface specifies the size to be 96 bits, so
9399 .Fl m96bit-long-double
9400 is the default in 32 bit mode.
9402 Modern architectures (Pentium and newer) would prefer
9404 to be aligned to an 8 or 16 byte boundary.
9405 In arrays or structures conforming to the ABI, this would not be possible.
9407 .Fl m128bit-long-double
9410 to a 16 byte boundary by padding the
9412 with an additional 32 bit zero.
9414 In the x86-64 compiler,
9415 .Fl m128bit-long-double
9416 is the default choice as its ABI specifies that
9418 is to be aligned on 16 byte boundary.
9420 Notice that neither of these options enable any extra precision over the x87 standard of 80 bits for a
9424 if you override the default value for your target ABI, the structures and arrays containing
9426 variables will change their size as well as function calling convention for function taking
9429 Hence they will not be binary compatible with arrays or structures in code compiled without that switch.
9431 .It Fl mmlarge-data-threshold= Ns Ar number
9434 is specified, the data greater than
9436 are placed in large data section.
9437 This value must be the same across all object linked into the binary and defaults to 65535.
9440 .It Fl mno-svr3-shlib
9441 Control whether GCC places uninitialized local variables into the
9449 These options are meaningful only on System V Release 3.
9452 Use a different function-calling convention, in which functions that take a fixed number of arguments return with the
9455 instruction, which pops their arguments while returning.
9456 This saves one instruction in the caller since there is no need to pop the arguments there.
9458 You can specify that an individual function is called with this calling sequence with the function attribute
9460 You can also override the
9462 option by using the function attribute
9466 this calling convention is incompatible with the one normally used on Unix, so you cannot use it if you need to call libraries compiled with the Unix compiler.
9468 Also, you must provide function prototypes for all functions that take variable numbers of arguments (including
9470 otherwise incorrect code will be generated for calls to those functions.
9472 In addition, seriously incorrect code will result if you call a function with too many arguments.
9473 (Normally, extra arguments are harmlessly ignored.)
9475 .It Fl mregparm= Ns Ar num
9476 Control how many registers are used to pass integer arguments.
9477 By default, no registers are used to pass arguments, and at most 3 registers can be used.
9478 You can control this behavior for a specific function by using the function attribute
9482 if you use this switch, and
9484 is nonzero, then you must build all modules with the same value, including any libraries.
9485 This includes the system libraries and startup modules.
9488 Use SSE register passing conventions for float and double arguments and return values.
9489 You can control this behavior for a specific function by using the function attribute
9493 if you use this switch then you must build all modules with the same value, including any libraries.
9494 This includes the system libraries and startup modules.
9496 .It Fl mpreferred-stack-boundary= Ns Ar num
9497 Attempt to keep the stack boundary aligned to a 2 raised to
9501 .Fl mpreferred-stack-boundary
9502 is not specified, the default is 4 (16 bytes or 128 bits).
9504 On Pentium and PentiumPro,
9508 values should be aligned to an 8 byte boundary (see
9510 or suffer significant run time performance penalties.
9511 On Pentium III, the Streaming SIMD Extension (SSE) data type
9513 may not work properly if it is not 16 byte aligned.
9515 To ensure proper alignment of this values on the stack, the stack boundary must be as aligned as that required by any value stored on the stack.
9516 Further, every function must be generated such that it keeps the stack aligned.
9517 Thus calling a function compiled with a higher preferred stack boundary from a function compiled with a lower preferred stack boundary will most likely misalign the stack.
9518 It is recommended that libraries that use callbacks always use the default setting.
9520 This extra alignment does consume extra stack space, and generally increases code size.
9521 Code that is sensitive to stack space usage, such as embedded systems and operating system kernels, may want to reduce the preferred alignment to
9522 .Fl mpreferred-stack-boundary=2 .
9534 These switches enable or disable the use of instructions in the MMX, SSE, SSE2 or 3DNow! extended instruction sets.
9535 These extensions are also available as built-in functions: see
9536 .Sy X86 Built-in Functions ,
9537 for details of the functions enabled and disabled by these switches.
9539 To have SSE/SSE2 instructions generated automatically from floating-point code (as opposed to 387 instructions), see
9542 These options will enable GCC to use these extended instructions in generated code, even without
9544 Applications which perform runtime CPU detection must compile separate files for each supported architecture, using the appropriate flags.
9545 In particular, the file containing the CPU detection code should be compiled without these options.
9548 .It Fl mno-push-args
9549 Use PUSH operations to store outgoing parameters.
9550 This method is shorter and usually equally fast as method using SUB/MOV operations and is enabled by default.
9551 In some cases disabling it may improve performance because of improved scheduling and reduced dependencies.
9553 .It Fl maccumulate-outgoing-args
9554 If enabled, the maximum amount of space required for outgoing arguments will be computed in the function prologue.
9555 This is faster on most modern CPUs because of reduced dependencies, improved scheduling and reduced stack usage when preferred stack boundary is not equal to 2.
9556 The drawback is a notable increase in code size.
9561 Support thread-safe exception handling on
9563 Code that relies on thread-safe exception handling must compile and link all code with the
9570 when linking, it links in a special thread helper library
9572 which cleans up per thread exception handling data.
9574 .It Fl mno-align-stringops
9575 Do not align destination of inlined string operations.
9576 This switch reduces code size and improves performance in case the destination is already aligned, but GCC doesn't know about it.
9578 .It Fl minline-all-stringops
9579 By default GCC inlines string operations only when destination is known to be aligned at least to 4 byte boundary.
9580 This enables more inlining, increase code size, but may improve performance of code that depends on fast memcpy, strlen and memset for short lengths.
9582 .It Fl momit-leaf-frame-pointer
9583 Don't keep the frame pointer in a register for leaf functions.
9584 This avoids the instructions to save, set up and restore frame pointers and makes an extra register available in leaf functions.
9586 .Fl fomit-frame-pointer
9587 removes the frame pointer for all functions which might make debugging harder.
9589 .It Fl mtls-direct-seg-refs
9590 .It Fl mno-tls-direct-seg-refs
9591 Controls whether TLS variables may be accessed with offsets from the TLS segment register
9595 for 64-bit), or whether the thread base pointer must be added.
9596 Whether or not this is legal depends on the operating system, and whether it maps the segment to cover the entire TLS area.
9598 For systems that use GNU libc, the default is on.
9603 switches are supported in addition to the above on AMD x86-64 processors in 64-bit environments.
9608 Generate code for a 32-bit or 64-bit environment.
9609 The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any i386 system.
9610 The 64-bit environment sets int to 32 bits and long and pointer to 64 bits and generates code for AMD's x86-64 architecture.
9613 Do not use a so called red zone for x86-64 code.
9614 The red zone is mandated by the x86-64 ABI, it is a 128-byte area beyond the location of the stack pointer that will not be modified by signal or interrupt handlers and therefore can be used for temporary data without adjusting the stack pointer.
9617 disables this red zone.
9619 .It Fl mcmodel=small
9620 Generate code for the small code model: the program and its symbols must be linked in the lower 2 GB of the address space.
9621 Pointers are 64 bits.
9622 Programs can be statically or dynamically linked.
9623 This is the default code model.
9625 .It Fl mcmodel=kernel
9626 Generate code for the kernel code model.
9627 The kernel runs in the negative 2 GB of the address space.
9628 This model has to be used for Linux kernel code.
9630 .It Fl mcmodel=medium
9631 Generate code for the medium model: The program is linked in the lower 2 GB of the address space but symbols can be located anywhere in the address space.
9632 Programs can be statically or dynamically linked, but building of shared libraries are not supported with the medium model.
9634 .It Fl mcmodel=large
9635 Generate code for the large model: This model makes no assumptions about addresses and sizes of sections.
9636 Currently GCC does not implement this model.
9639 .It Sy IA-64 Options
9642 options defined for the Intel IA-64 architecture.
9646 Generate code for a big endian target.
9647 This is the default for HP-UX.
9649 .It Fl mlittle-endian
9650 Generate code for a little endian target.
9651 This is the default for AIX5 and GNU/Linux.
9655 Generate (or don't) code for the GNU assembler.
9656 This is the default.
9660 Generate (or don't) code for the GNU linker.
9661 This is the default.
9664 Generate code that does not use a global pointer register.
9665 The result is not position independent code, and violates the IA-64 ABI.
9667 .It Fl mvolatile-asm-stop
9668 .It Fl mno-volatile-asm-stop
9669 Generate (or don't) a stop bit immediately before and after volatile asm statements.
9671 .It Fl mregister-names
9672 .It Fl mno-register-names
9678 register names for the stacked registers.
9679 This may make assembler output more readable.
9683 Disable (or enable) optimizations that use the small data section.
9684 This may be useful for working around optimizer bugs.
9687 Generate code that uses a single constant global pointer value.
9688 This is useful when compiling kernel code.
9691 Generate code that is self-relocatable.
9694 This is useful when compiling firmware code.
9696 .It Fl minline-float-divide-min-latency
9697 Generate code for inline divides of floating point values using the minimum latency algorithm.
9699 .It Fl minline-float-divide-max-throughput
9700 Generate code for inline divides of floating point values using the maximum throughput algorithm.
9702 .It Fl minline-int-divide-min-latency
9703 Generate code for inline divides of integer values using the minimum latency algorithm.
9705 .It Fl minline-int-divide-max-throughput
9706 Generate code for inline divides of integer values using the maximum throughput algorithm.
9708 .It Fl minline-sqrt-min-latency
9709 Generate code for inline square roots using the minimum latency algorithm.
9711 .It Fl minline-sqrt-max-throughput
9712 Generate code for inline square roots using the maximum throughput algorithm.
9714 .It Fl mno-dwarf2-asm
9716 Don't (or do) generate assembler code for the DWARF2 line number debugging info.
9717 This may be useful when not using the GNU assembler.
9719 .It Fl mearly-stop-bits
9720 .It Fl mno-early-stop-bits
9721 Allow stop bits to be placed earlier than immediately preceding the instruction that triggered the stop bit.
9722 This can improve instruction scheduling, but does not always do so.
9724 .It Fl mfixed-range= Ns Ar register-range
9725 Generate code treating the given register range as fixed registers.
9726 A fixed register is one that the register allocator can not use.
9727 This is useful when compiling kernel code.
9728 A register range is specified as two registers separated by a dash.
9729 Multiple register ranges can be specified separated by a comma.
9731 .It Fl mtls-size= Ns Ar tls-size
9732 Specify bit size of immediate TLS offsets.
9733 Valid values are 14, 22, and 64.
9735 .It Fl mtune= Ns Ar cpu-type
9736 Tune the instruction scheduling for a particular CPU, Valid values are itanium, itanium1, merced, itanium2, and mckinley.
9740 Add support for multithreading using the POSIX threads library.
9741 This option sets flags for both the preprocessor and linker.
9742 It does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it.
9743 These are HP-UX specific flags.
9747 Generate code for a 32-bit or 64-bit environment.
9748 The 32-bit environment sets int, long and pointer to 32 bits.
9749 The 64-bit environment sets int to 32 bits and long and pointer to 64 bits.
9750 These are HP-UX specific flags.
9755 .It Fl mcpu= Ns Ar name
9756 Select the CPU for which code is generated.
9760 for the R8C/Tiny series,
9762 for the M16C (up to /60) series,
9764 for the M16C/80 series, or
9766 for the M32C/80 series.
9769 Specifies that the program will be run on the simulator.
9770 This causes an alternate runtime library to be linked in which supports, for example, file I/O.
9771 You must not use this option when generating programs that will run on real hardware; you must provide your own runtime library for whatever I/O functions are needed.
9773 .It Fl memregs= Ns Ar number
9774 Specifies the number of memory-based pseudo-registers GCC will use during code generation.
9775 These pseudo-registers will be used like real registers, so there is a tradeoff between GCC's ability to fit the code into available registers, and the performance penalty of using memory instead of registers.
9776 Note that all modules in a program must be compiled with the same value for this option.
9777 Because of that, you must not use this option with the default runtime libraries gcc builds.
9780 .It Sy M32R/D Options
9783 options are defined for Renesas M32R/D architectures:
9787 Generate code for the M32R/2.
9790 Generate code for the M32R/X.
9793 Generate code for the M32R.
9794 This is the default.
9797 Assume all objects live in the lower 16MB of memory (so that their addresses can be loaded with the
9799 instruction), and assume all subroutines are reachable with the
9802 This is the default.
9804 The addressability of a particular object can be set with the
9808 .It Fl mmodel=medium
9809 Assume objects may be anywhere in the 32-bit address space (the compiler will generate
9811 instructions to load their addresses), and assume all subroutines are reachable with the
9816 Assume objects may be anywhere in the 32-bit address space (the compiler will generate
9818 instructions to load their addresses), and assume subroutines may not be reachable with the
9820 instruction (the compiler will generate the much slower
9822 instruction sequence).
9825 Disable use of the small data area.
9826 Variables will be put into one of
9833 attribute has been specified).
9834 This is the default.
9836 The small data area consists of sections
9840 Objects may be explicitly put in the small data area with the
9842 attribute using one of these sections.
9845 Put small global and static data in the small data area, but do not generate special code to reference them.
9848 Put small global and static data in the small data area, and generate special instructions to reference them.
9851 Put global and static objects less than or equal to
9853 bytes into the small data or bss sections instead of the normal data or bss sections.
9854 The default value of
9859 option must be set to one of
9863 for this option to have any effect.
9865 All modules should be compiled with the same
9868 Compiling with different values of
9870 may or may not work; if it doesn't the linker will give an error message---incorrect code will not be generated.
9873 Makes the M32R specific code in the compiler display some statistics that might help in debugging programs.
9876 Align all loops to a 32-byte boundary.
9878 .It Fl mno-align-loops
9879 Do not enforce a 32-byte alignment for loops.
9880 This is the default.
9882 .It Fl missue-rate= Ns Ar number
9885 instructions per cycle.
9889 .It Fl mbranch-cost= Ns Ar number
9892 If it is 1 then branches will be preferred over conditional code, if it is 2, then the opposite will apply.
9894 .It Fl mflush-trap= Ns Ar number
9895 Specifies the trap number to use to flush the cache.
9897 Valid numbers are between 0 and 15 inclusive.
9899 .It Fl mno-flush-trap
9900 Specifies that the cache cannot be flushed by using a trap.
9902 .It Fl mflush-func= Ns Ar name
9903 Specifies the name of the operating system function to call to flush the cache.
9906 but a function call will only be used if a trap is not available.
9908 .It Fl mno-flush-func
9909 Indicates that there is no OS function for flushing the cache.
9912 .It Sy M680x0 Options
9915 options defined for the 68000 series.
9916 The default values for these options depends on which style of 68000 was selected when the compiler was configured; the defaults for the most common choices are given below.
9921 Generate output for a 68000.
9922 This is the default when the compiler is configured for 68000-based systems.
9924 Use this option for microcontrollers with a 68000 or EC000 core, including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
9928 Generate output for a 68020.
9929 This is the default when the compiler is configured for 68020-based systems.
9932 Generate output containing 68881 instructions for floating point.
9933 This is the default for most 68020 systems unless
9935 was specified when the compiler was configured.
9938 Generate output for a 68030.
9939 This is the default when the compiler is configured for 68030-based systems.
9942 Generate output for a 68040.
9943 This is the default when the compiler is configured for 68040-based systems.
9945 This option inhibits the use of 68881/68882 instructions that have to be emulated by software on the 68040.
9946 Use this option if your 68040 does not have code to emulate those instructions.
9949 Generate output for a 68060.
9950 This is the default when the compiler is configured for 68060-based systems.
9952 This option inhibits the use of 68020 and 68881/68882 instructions that have to be emulated by software on the 68060.
9953 Use this option if your 68060 does not have code to emulate those instructions.
9956 Generate output for a CPU32.
9957 This is the default when the compiler is configured for CPU32-based systems.
9959 Use this option for microcontrollers with a CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334, 68336, 68340, 68341, 68349 and 68360.
9962 Generate output for a 520X "coldfire" family cpu.
9963 This is the default when the compiler is configured for 520X-based systems.
9965 Use this option for microcontroller with a 5200 core, including the MCF5202, MCF5203, MCF5204 and MCF5202.
9968 Generate output for a 68040, without using any of the new instructions.
9969 This results in code which can run relatively efficiently on either a 68020/68881 or a 68030 or a 68040.
9970 The generated code does use the 68881 instructions that are emulated on the 68040.
9973 Generate output for a 68060, without using any of the new instructions.
9974 This results in code which can run relatively efficiently on either a 68020/68881 or a 68030 or a 68040.
9975 The generated code does use the 68881 instructions that are emulated on the 68060.
9978 Generate output containing library calls for floating point.
9980 the requisite libraries are not available for all m68k targets.
9981 Normally the facilities of the machine's usual C compiler are used, but this can't be done directly in cross-compilation.
9982 You must make your own arrangements to provide suitable library functions for cross-compilation.
9983 The embedded targets
9987 do provide software floating point support.
9992 to be 16 bits wide, like
9994 Additionally, parameters passed on the stack are also aligned to a 16-bit boundary even on targets whose API mandates promotion to 32-bit.
9997 Do not use the bit-field instructions.
10007 Do use the bit-field instructions.
10012 This is the default if you use a configuration designed for a 68020.
10015 Use a different function-calling convention, in which functions that take a fixed number of arguments return with the
10017 instruction, which pops their arguments while returning.
10018 This saves one instruction in the caller since there is no need to pop the arguments there.
10020 This calling convention is incompatible with the one normally used on Unix, so you cannot use it if you need to call libraries compiled with the Unix compiler.
10022 Also, you must provide function prototypes for all functions that take variable numbers of arguments (including
10024 otherwise incorrect code will be generated for calls to those functions.
10026 In addition, seriously incorrect code will result if you call a function with too many arguments.
10027 (Normally, extra arguments are harmlessly ignored.)
10031 instruction is supported by the 68010, 68020, 68030, 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10034 .It Fl mno-align-int
10035 Control whether GCC aligns
10043 variables on a 32-bit boundary
10045 or a 16-bit boundary
10046 .Fl ( mno-align-int ) .
10047 Aligning variables on 32-bit boundaries produces code that runs somewhat faster on processors with 32-bit busses at the expense of more memory.
10052 switch, GCC will align structures containing the above types differently than most published application binary interface specifications for the m68k.
10055 Use the pc-relative addressing mode of the 68000 directly, instead of using a global offset table.
10056 At present, this option implies
10058 allowing at most a 16-bit offset for pc-relative addressing.
10060 is not presently supported with
10062 though this could be supported for 68020 and higher processors.
10064 .It Fl mno-strict-align
10065 .It Fl mstrict-align
10066 Do not (do) assume that unaligned memory references will be handled by the system.
10069 Generate code that allows the data segment to be located in a different area of memory from the text segment.
10070 This allows for execute in place in an environment without virtual memory management.
10071 This option implies
10074 .It Fl mno-sep-data
10075 Generate code that assumes that the data segment follows the text segment.
10076 This is the default.
10078 .It Fl mid-shared-library
10079 Generate code that supports shared libraries via the library ID method.
10080 This allows for execute in place and shared libraries in an environment without virtual memory management.
10081 This option implies
10084 .It Fl mno-id-shared-library
10085 Generate code that doesn't assume ID based shared libraries are being used.
10086 This is the default.
10088 .It Fl mshared-library-id=n
10089 Specified the identification number of the ID based shared library being compiled.
10090 Specifying a value of 0 will generate more compact code, specifying other values will force the allocation of that number to the current library but is no more space or time efficient than omitting this option.
10093 .It Sy M68hc1x Options
10096 options defined for the 68hc11 and 68hc12 microcontrollers.
10097 The default values for these options depends on which style of microcontroller was selected when the compiler was configured; the defaults for the most common choices are given below.
10102 Generate output for a 68HC11.
10103 This is the default when the compiler is configured for 68HC11-based systems.
10107 Generate output for a 68HC12.
10108 This is the default when the compiler is configured for 68HC12-based systems.
10112 Generate output for a 68HCS12.
10114 .It Fl mauto-incdec
10115 Enable the use of 68HC12 pre and post auto-increment and auto-decrement addressing modes.
10119 Enable the use of 68HC12 min and max instructions.
10122 .It Fl mno-long-calls
10123 Treat all calls as being far away (near).
10124 If calls are assumed to be far away, the compiler will use the
10126 instruction to call a function and the
10128 instruction for returning.
10133 to be 16 bits wide, like
10136 .It Fl msoft-reg-count= Ns Ar count
10137 Specify the number of pseudo-soft registers which are used for the code generation.
10138 The maximum number is 32.
10139 Using more pseudo-soft register may or may not result in better code depending on the program.
10140 The default is 4 for 68HC11 and 2 for 68HC12.
10143 .It Sy MCore Options
10146 options defined for the Motorola M*Core processors.
10151 Inline constants into the code stream if it can be done in two instructions or less.
10155 Use the divide instruction.
10156 (Enabled by default).
10158 .It Fl mrelax-immediate
10159 .It Fl mno-relax-immediate
10160 Allow arbitrary sized immediates in bit operations.
10162 .It Fl mwide-bitfields
10163 .It Fl mno-wide-bitfields
10164 Always treat bit-fields as int-sized.
10166 .It Fl m4byte-functions
10167 .It Fl mno-4byte-functions
10168 Force all functions to be aligned to a four byte boundary.
10170 .It Fl mcallgraph-data
10171 .It Fl mno-callgraph-data
10172 Emit callgraph information.
10175 .It Fl mno-slow-bytes
10176 Prefer word access when reading byte quantities.
10178 .It Fl mlittle-endian
10180 Generate code for a little endian target.
10184 Generate code for the 210 processor.
10187 .It Sy MIPS Options
10190 Generate big-endian code.
10193 Generate little-endian code.
10194 This is the default for
10198 .It Fl march= Ns Ar arch
10199 Generate code that will run on
10201 which can be the name of a generic MIPS ISA, or the name of a particular processor.
10211 The processor names are:
10248 selects the most compatible architecture for the selected ABI (that is,
10250 for 32-bit ABIs and
10254 In processor names, a final
10256 can be abbreviated as
10260 Prefixes are optional, and
10265 GCC defines two macros based on the value of this option.
10268 which gives the name of target architecture, as a string.
10269 The second has the form
10274 is the capitalized value of
10282 and define the macro
10283 .Sy _MIPS_ARCH_R2000 .
10287 macro uses the processor names given above.
10288 In other words, it will have the full prefix and will not abbreviate
10294 the macro names the resolved architecture (either
10298 It names the default architecture when no
10302 .It Fl mtune= Ns Ar arch
10305 Among other things, this option controls the way instructions are scheduled, and the perceived cost of arithmetic operations.
10308 values is the same as for
10311 When this option is not used, GCC will optimize for the processor specified by
10317 together, it is possible to generate code that will run on a family of processors, but optimize the code for one particular member of that family.
10325 which work in the same way as the
10327 ones described above.
10351 .Fl march=mips32r2 .
10359 Generate (do not generate) MIPS16 code.
10360 If GCC is targetting a MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE.
10367 Generate code for the given ABI.
10369 Note that the EABI has a 32-bit and a 64-bit variant.
10370 GCC normally generates 64-bit code when you select a 64-bit architecture, but you can use
10372 to get 32-bit code instead.
10374 For information about the O64 ABI, see
10375 .Lk http://gcc.gnu.org/projects/mipso64-abi.html .
10378 .It Fl mno-abicalls
10379 Generate (do not generate) SVR4-style position-independent code.
10381 is the default for SVR4-based systems.
10385 Lift (do not lift) the usual restrictions on the size of the global offset table.
10387 GCC normally uses a single instruction to load values from the GOT.
10388 While this is relatively efficient, it will only work if the GOT is smaller than about 64k.
10389 Anything larger will cause the linker to report an error such as:
10391 .Bd -literal -offset indent
10392 relocation truncated to fit: R_MIPS_GOT16 foobar
10394 If this happens, you should recompile your code with
10396 It should then work with very large GOTs, although it will also be less efficient, since it will take three instructions to fetch the value of a global symbol.
10398 Note that some linkers can create multiple GOTs.
10399 If you have such a linker, you should only need to use
10401 when a single object file accesses more than 64k's worth of GOT entries.
10404 These options have no effect unless GCC is generating position independent code.
10407 Assume that general-purpose registers are 32 bits wide.
10410 Assume that general-purpose registers are 64 bits wide.
10413 Assume that floating-point registers are 32 bits wide.
10416 Assume that floating-point registers are 64 bits wide.
10419 Use floating-point coprocessor instructions.
10422 Do not use floating-point coprocessor instructions.
10423 Implement floating-point calculations using library calls instead.
10425 .It Fl msingle-float
10426 Assume that the floating-point coprocessor only supports single-precision operations.
10428 .It Fl mdouble-float
10429 Assume that the floating-point coprocessor supports double-precision operations.
10430 This is the default.
10434 Use (do not use) the MIPS DSP ASE.
10436 .It Fl mpaired-single
10437 .It Fl mno-paired-single
10438 Use (do not use) paired-single floating-point instructions.
10439 This option can only be used when generating 64-bit code and requires hardware floating-point support to be enabled.
10443 Use (do not use) the MIPS-3D ASE.
10447 .Fl mpaired-single .
10452 types to be 64 bits wide.
10455 for an explanation of the default and the way that the pointer size is determined.
10461 and pointer types to be 32 bits wide.
10463 The default size of
10467 s and pointers depends on the ABI.
10468 All the supported ABIs use 32-bit
10471 The n64 ABI uses 64-bit
10473 s, as does the 64-bit EABI; the others use 32-bit
10476 Pointers are the same size as
10478 s, or the same size as integer registers, whichever is smaller.
10482 Assume (do not assume) that all symbols have 32-bit values, regardless of the selected ABI.
10483 This option is useful in combination with
10487 because it allows GCC to generate shorter and faster references to symbolic addresses.
10490 Put global and static items less than or equal to
10492 bytes into the small data or bss section instead of the normal data or bss section.
10493 This allows the data to be accessed using a single instruction.
10495 All modules should be compiled with the same
10499 .It Fl membedded-data
10500 .It Fl mno-embedded-data
10501 Allocate variables to the read-only data section first if possible, then next in the small data section if possible, otherwise in data.
10502 This gives slightly slower code than the default, but reduces the amount of RAM required when executing, and thus may be preferred for some embedded systems.
10504 .It Fl muninit-const-in-rodata
10505 .It Fl mno-uninit-const-in-rodata
10508 variables in the read-only data section.
10509 This option is only meaningful in conjunction with
10510 .Fl membedded-data .
10512 .It Fl msplit-addresses
10513 .It Fl mno-split-addresses
10514 Enable (disable) use of the
10518 assembler relocation operators.
10519 This option has been superseded by
10520 .Fl mexplicit-relocs
10521 but is retained for backwards compatibility.
10523 .It Fl mexplicit-relocs
10524 .It Fl mno-explicit-relocs
10525 Use (do not use) assembler relocation operators when dealing with symbolic addresses.
10526 The alternative, selected by
10527 .Fl mno-explicit-relocs ,
10528 is to use assembler macros instead.
10530 .Fl mexplicit-relocs
10531 is the default if GCC was configured to use an assembler that supports relocation operators.
10533 .It Fl mcheck-zero-division
10534 .It Fl mno-check-zero-division
10535 Trap (do not trap) on integer division by zero.
10537 .Fl mcheck-zero-division .
10539 .It Fl mdivide-traps
10540 .It Fl mdivide-breaks
10541 MIPS systems check for division by zero by generating either a conditional trap or a break instruction.
10542 Using traps results in smaller code, but is only supported on MIPS II and later.
10543 Also, some versions of the Linux kernel have a bug that prevents trap from generating the proper signal
10547 to allow conditional traps on architectures that support them and
10549 to force the use of breaks.
10551 The default is usually
10552 .Fl mdivide-traps ,
10553 but this can be overridden at configure time using
10554 .Fl -with-divide=breaks .
10555 Divide-by-zero checks can be completely disabled using
10556 .Fl mno-check-zero-division .
10560 Force (do not force) the use of
10562 for non-trivial block moves.
10565 which allows GCC to inline most constant-sized copies.
10568 .It Fl mno-long-calls
10569 Disable (do not disable) use of the
10572 Calling functions using
10574 is more efficient but requires the caller and callee to be in the same 256 megabyte segment.
10576 This option has no effect on abicalls code.
10578 .Fl mno-long-calls .
10582 Enable (disable) use of the
10587 instructions, as provided by the R4650 ISA.
10590 .It Fl mno-fused-madd
10591 Enable (disable) use of the floating point multiply-accumulate instructions, when they are available.
10595 When multiply-accumulate instructions are used, the intermediate product is calculated to infinite precision and is not subject to the FCSR Flush to Zero bit.
10596 This may be undesirable in some circumstances.
10599 Tell the MIPS assembler to not run its preprocessor over user assembler files (with a
10601 suffix) when assembling them.
10604 .It Fl mno-fix-r4000
10605 Work around certain R4000 CPU errata:
10609 A double-word or a variable shift may give an incorrect result if executed immediately after starting an integer division.
10612 A double-word or a variable shift may give an incorrect result if executed while an integer multiplication is in progress.
10615 An integer division may give an incorrect result if started in a delay slot of a taken branch or a jump.
10619 .It Fl mno-fix-r4400
10620 Work around certain R4400 CPU errata:
10624 A double-word or a variable shift may give an incorrect result if executed immediately after starting an integer division.
10628 .It Fl mno-fix-vr4120
10629 Work around certain VR4120 errata:
10634 does not always produce the correct result.
10640 do not always produce the correct result if one of the operands is negative.
10643 The workarounds for the division errata rely on special functions in
10645 At present, these functions are only provided by the
10649 Other VR4120 errata require a nop to be inserted between certain pairs of instructions.
10650 These errata are handled by the assembler, not by GCC itself.
10653 Work around the VR4130
10658 The workarounds are implemented by the assembler rather than by GCC, although GCC will avoid using
10668 instructions are available instead.
10672 Work around certain SB-1 CPU core errata.
10673 (This flag currently works around the SB-1 revision 2 "F1" and "F2" floating point errata.)
10675 .It Fl mflush-func= Ns Ar func
10676 .It Fl mno-flush-func
10677 Specifies the function to call to flush the I and D caches, or to not call any such function.
10678 If called, the function must take the same arguments as the common
10679 .Va _flush_func() ,
10680 that is, the address of the memory range for which the cache is being flushed, the size of the memory range, and the number 3 (to flush both caches).
10681 The default depends on the target GCC was configured for, but commonly is either
10686 .It Fl mbranch-likely
10687 .It Fl mno-branch-likely
10688 Enable or disable use of Branch Likely instructions, regardless of the default for the selected architecture.
10689 By default, Branch Likely instructions may be generated if they are supported by the selected architecture.
10690 An exception is for the MIPS32 and MIPS64 architectures and processors which implement those architectures; for those, Branch Likely instructions will not be generated by default because the MIPS32 and MIPS64 architectures specifically deprecate their use.
10692 .It Fl mfp-exceptions
10693 .It Fl mno-fp-exceptions
10694 Specifies whether FP exceptions are enabled.
10695 This affects how we schedule FP instructions for some processors.
10696 The default is that FP exceptions are enabled.
10698 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting 64-bit code, then we can use both FP pipes.
10699 Otherwise, we can only use one FP pipe.
10701 .It Fl mvr4130-align
10702 .It Fl mno-vr4130-align
10703 The VR4130 pipeline is two-way superscalar, but can only issue two instructions together if the first one is 8-byte aligned.
10704 When this option is enabled, GCC will align pairs of instructions that it thinks should execute in parallel.
10706 This option only has an effect when optimizing for the VR4130.
10707 It normally makes code faster, but at the expense of making it bigger.
10708 It is enabled by default at optimization level
10712 .It Sy MMIX Options
10713 These options are defined for the MMIX:
10717 .It Fl mno-libfuncs
10718 Specify that intrinsic library functions are being compiled, passing all values in registers, no matter the size.
10722 Generate floating-point comparison instructions that compare with respect to the
10726 .It Fl mabi=mmixware
10728 Generate code that passes function parameters and return values that (in the called function) are seen as registers
10730 and up, as opposed to the GNU ABI which uses global registers
10734 .It Fl mzero-extend
10735 .It Fl mno-zero-extend
10736 When reading data from memory in sizes shorter than 64 bits, use (do not use) zero-extending load instructions by default, rather than sign-extending ones.
10739 .It Fl mno-knuthdiv
10740 Make the result of a division yielding a remainder have the same sign as the divisor.
10743 the sign of the remainder follows the sign of the dividend.
10744 Both methods are arithmetically valid, the latter being almost exclusively used.
10746 .It Fl mtoplevel-symbols
10747 .It Fl mno-toplevel-symbols
10748 Prepend (do not prepend) a
10750 to all global symbols, so the assembly code can be used with the
10752 assembly directive.
10755 Generate an executable in the ELF format, rather than the default
10761 .It Fl mbranch-predict
10762 .It Fl mno-branch-predict
10763 Use (do not use) the probable-branch instructions, when static branch prediction indicates a probable branch.
10765 .It Fl mbase-addresses
10766 .It Fl mno-base-addresses
10767 Generate (do not generate) code that uses
10768 .Em base addresses .
10769 Using a base address automatically generates a request (handled by the assembler and the linker) for a constant to be set up in a global register.
10770 The register is used for one or more base address requests within the range 0 to 255 from the value held in the register.
10771 The generally leads to short and fast code, but the number of different data items that can be addressed is limited.
10772 This means that a program that uses lots of static data may require
10773 .Fl mno-base-addresses .
10775 .It Fl msingle-exit
10776 .It Fl mno-single-exit
10777 Force (do not force) generated code to have a single exit point in each function.
10780 .It Sy MN10300 Options
10783 options are defined for Matsushita MN10300 architectures:
10787 Generate code to avoid bugs in the multiply instructions for the MN10300 processors.
10788 This is the default.
10790 .It Fl mno-mult-bug
10791 Do not generate code to avoid bugs in the multiply instructions for the MN10300 processors.
10794 Generate code which uses features specific to the AM33 processor.
10797 Do not generate code which uses features specific to the AM33 processor.
10798 This is the default.
10800 .It Fl mreturn-pointer-on-d0
10801 When generating a function which returns a pointer, return the pointer in both
10805 Otherwise, the pointer is returned only in a0, and attempts to call such functions without a prototype would result in errors.
10806 Note that this option is on by default; use
10807 .Fl mno-return-pointer-on-d0
10811 Do not link in the C run-time initialization object file.
10814 Indicate to the linker that it should perform a relaxation optimization pass to shorten branches, calls and absolute memory addresses.
10815 This option only has an effect when used on the command line for the final link step.
10817 This option makes symbolic debugging impossible.
10823 options are defined for Morpho MT architectures:
10826 .It Fl march= Ns Ar cpu-type
10827 Generate code that will run on
10829 which is the name of a system representing a certain processor type.
10830 Possible values for
10839 When this option is not used, the default is
10840 .Fl march=ms1-16-002 .
10843 Use byte loads and stores when generating code.
10846 Do not use byte loads and stores when generating code.
10849 Use simulator runtime
10852 Do not link in the C run-time initialization object file
10854 Other run-time initialization and termination files such as
10858 are still included on the linker command line.
10861 .It Sy PDP-11 Options
10862 These options are defined for the PDP-11:
10866 Use hardware FPP floating point.
10867 This is the default.
10868 (FIS floating point on the PDP-11/40 is not supported.)
10871 Do not use hardware floating point.
10874 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
10877 Return floating-point results in memory.
10878 This is the default.
10881 Generate code for a PDP-11/40.
10884 Generate code for a PDP-11/45.
10885 This is the default.
10888 Generate code for a PDP-11/10.
10890 .It Fl mbcopy-builtin
10893 patterns for copying memory.
10894 This is the default.
10899 patterns for copying memory.
10905 This is the default.
10916 This is the default.
10927 This is the default.
10934 .It Fl mbranch-expensive
10935 Pretend that branches are expensive.
10936 This is for experimenting with code generation only.
10938 .It Fl mbranch-cheap
10939 Do not pretend that branches are expensive.
10940 This is the default.
10943 Generate code for a system with split I&D.
10946 Generate code for a system without split I&D.
10947 This is the default.
10950 Use Unix assembler syntax.
10951 This is the default when configured for
10955 Use DEC assembler syntax.
10956 This is the default when configured for any PDP-11 target other than
10960 .It Sy PowerPC Options
10961 These are listed under
10962 .It Sy IBM RS/6000 and PowerPC Options
10965 options are defined for the IBM RS/6000 and PowerPC:
10974 .It Fl mpowerpc-gpopt
10975 .It Fl mno-powerpc-gpopt
10976 .It Fl mpowerpc-gfxopt
10977 .It Fl mno-powerpc-gfxopt
10979 .It Fl mno-powerpc64
10986 GCC supports two related instruction set architectures for the RS/6000 and PowerPC.
10989 instruction set are those instructions supported by the
10991 chip set used in the original RS/6000 systems and the
10993 instruction set is the architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and the IBM 4xx, 6xx, and follow-on microprocessors.
10995 Neither architecture is a subset of the other.
10996 However there is a large common subset of instructions supported by both.
10997 An MQ register is included in processors supporting the POWER architecture.
10999 You use these options to specify which instructions are available on the processor you are using.
11000 The default value of these options is determined when configuring GCC.
11002 .Fl mcpu= Ns Ar cpu_type
11003 overrides the specification of these options.
11004 We recommend you use the
11005 .Fl mcpu= Ns Ar cpu_type
11006 option rather than the options listed above.
11010 option allows GCC to generate instructions that are found only in the POWER architecture and to use the MQ register.
11015 and also allows GCC to generate instructions that are present in the POWER2 architecture but not the original POWER architecture.
11019 option allows GCC to generate instructions that are found only in the 32-bit subset of the PowerPC architecture.
11024 and also allows GCC to use the optional PowerPC architecture instructions in the General Purpose group, including floating-point square root.
11026 .Fl mpowerpc-gfxopt
11029 and also allows GCC to use the optional PowerPC architecture instructions in the Graphics group, including floating-point select.
11033 option allows GCC to generate the move from condition register field instruction implemented on the POWER4 processor and other processors that support the PowerPC V2.01 architecture.
11036 option allows GCC to generate the popcount and double precision FP reciprocal estimate instruction implemented on the POWER5 processor and other processors that support the PowerPC V2.02 architecture.
11039 option allows GCC to generate the FP round to integer instructions implemented on the POWER5+ processor and other processors that support the PowerPC V2.03 architecture.
11043 option allows GCC to generate the additional 64-bit instructions that are found in the full PowerPC64 architecture and to treat GPRs as 64-bit, doubleword quantities.
11045 .Fl mno-powerpc64 .
11047 If you specify both
11051 GCC will use only the instructions in the common subset of both architectures plus some special AIX common-mode calls, and will not use the MQ register.
11056 permits GCC to use any instruction from either architecture and to allow use of the MQ register; specify this for the Motorola MPC601.
11058 .It Fl mnew-mnemonics
11059 .It Fl mold-mnemonics
11060 Select which mnemonics to use in the generated assembler code.
11062 .Fl mnew-mnemonics ,
11063 GCC uses the assembler mnemonics defined for the PowerPC architecture.
11066 it uses the assembler mnemonics defined for the POWER architecture.
11067 Instructions defined in only one architecture have only one mnemonic; GCC uses that mnemonic irrespective of which of these options is specified.
11069 GCC defaults to the mnemonics appropriate for the architecture in use.
11071 .Fl mcpu= Ns Ar cpu_type
11072 sometimes overrides the value of these option.
11073 Unless you are building a cross-compiler, you should normally not specify either
11076 .Fl mold-mnemonics ,
11077 but should instead accept the default.
11079 .It Fl mcpu= Ns Ar cpu_type
11080 Set architecture type, register usage, choice of mnemonics, and instruction scheduling parameters for machine type
11082 Supported values for
11132 selects a completely generic processor.
11133 Code generated under this option will run on any POWER or PowerPC processor.
11134 GCC will use only the instructions in the common subset of both architectures, and will not use the MQ register.
11135 GCC assumes a generic processor model for scheduling purposes.
11142 specify generic POWER, POWER2, pure 32-bit PowerPC (i.e., not MPC601), and 64-bit PowerPC architecture machine types, with an appropriate, generic processor model assumed for scheduling purposes.
11144 The other options specify a specific processor.
11145 Code generated under those options will run best on that processor, and may not run at all on others.
11149 options automatically enable or disable the following options:
11155 .Fl mnew-mnemonics ,
11160 .Fl mpowerpc-gpopt ,
11161 .Fl mpowerpc-gfxopt ,
11163 The particular options set for any particular CPU will vary between compiler versions, depending on what setting seems to produce optimal code for that CPU; it doesn't necessarily reflect the actual hardware's capabilities.
11164 If you wish to set an individual option to a particular value, you may specify it after the
11167 .Fl mcpu=970 Fl mno-altivec .
11173 options are not enabled or disabled by the
11175 option at present because AIX does not have full support for these options.
11176 You may still enable or disable them individually if you're sure it'll work in your environment.
11178 .It Fl mtune= Ns Ar cpu_type
11179 Set the instruction scheduling parameters for machine type
11181 but do not set the architecture type, register usage, or choice of mnemonics, as
11182 .Fl mcpu= Ns Ar cpu_type
11184 The same values for
11190 If both are specified, the code generated will use the architecture, registers, and mnemonics set by
11192 but the scheduling parameters set by
11197 Generate code to compute division as reciprocal estimate and iterative refinement, creating opportunities for increased throughput.
11198 This feature requires: optional PowerPC Graphics instruction set for single precision and FRE instruction for double precision, assuming divides cannot generate user-visible traps, and the domain values not include Infinities, denormals or zero denominator.
11202 Generate code that uses (does not use) AltiVec instructions, and also enable the use of built-in functions that allow more direct access to the AltiVec instruction set.
11203 You may also need to set
11205 to adjust the current ABI with AltiVec ABI enhancements.
11209 Generate VRSAVE instructions when generating AltiVec code.
11212 Generate code that allows ld and ld.so to build executables and shared libraries with non-exec .plt and .got sections.
11213 This is a PowerPC 32-bit SYSV ABI option.
11216 Generate code that uses a BSS .plt section that ld.so fills in, and requires .plt and .got sections that are both writable and executable.
11217 This is a PowerPC 32-bit SYSV ABI option.
11221 This switch enables or disables the generation of ISEL instructions.
11223 .It Fl misel= Ns Ar yes/no
11224 This switch has been deprecated.
11233 This switch enables or disables the generation of SPE simd instructions.
11235 .It Fl mspe= Ns Ar yes/no
11236 This option has been deprecated.
11243 .It Fl mfloat-gprs= Ns Ar yes/single/double/no
11245 This switch enables or disables the generation of floating point operations on the general purpose registers for architectures that support it.
11251 enables the use of single-precision floating point operations.
11255 enables the use of single and double-precision floating point operations.
11259 disables floating point operations on the general purpose registers.
11261 This option is currently only available on the MPC854x.
11265 Generate code for 32-bit or 64-bit environments of Darwin and SVR4 targets (including GNU/Linux).
11266 The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any PowerPC variant.
11267 The 64-bit environment sets int to 32 bits and long and pointer to 64 bits, and generates code for PowerPC64, as for
11271 .It Fl mno-fp-in-toc
11272 .It Fl mno-sum-in-toc
11273 .It Fl mminimal-toc
11274 Modify generation of the TOC (Table Of Contents), which is created for every executable file.
11277 option is selected by default.
11278 In that case, GCC will allocate at least one TOC entry for each unique non-automatic variable reference in your program.
11279 GCC will also place floating-point constants in the TOC.
11280 However, only 16,384 entries are available in the TOC.
11282 If you receive a linker error message that saying you have overflowed the available TOC space, you can reduce the amount of TOC space used with the
11288 prevents GCC from putting floating-point constants in the TOC and
11290 forces GCC to generate code to calculate the sum of an address and a constant at run-time instead of putting that sum into the TOC.
11291 You may specify one or both of these options.
11292 Each causes GCC to produce very slightly slower and larger code at the expense of conserving TOC space.
11294 If you still run out of space in the TOC even when you specify both of these options, specify
11297 This option causes GCC to make only one TOC entry for every file.
11298 When you specify this option, GCC will produce code that is slower and larger but which uses extremely little TOC space.
11299 You may wish to use this option only on files that contain less frequently executed code.
11303 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11305 type, and the infrastructure needed to support them.
11314 disables the 64-bit ABI and implies
11315 .Fl mno-powerpc64 .
11320 .It Fl mno-xl-compat
11321 Produce code that conforms more closely to IBM XL compiler semantics when using AIX-compatible ABI.
11322 Pass floating-point arguments to prototyped functions beyond the register save area (RSA) on the stack in addition to argument FPRs.
11323 Do not assume that most significant double in 128-bit long double value is properly rounded when comparing values and converting to double.
11324 Use XL symbol names for long double support routines.
11326 The AIX calling convention was extended but not initially documented to handle an obscure K&R C case of calling a function that takes the address of its arguments with fewer arguments than declared.
11327 IBM XL compilers access floating point arguments which do not fit in the RSA from the stack when a subroutine is compiled without optimization.
11328 Because always storing floating-point arguments on the stack is inefficient and rarely needed, this option is not enabled by default and only is necessary when calling subroutines compiled by IBM XL compilers without optimization.
11333 .Em Parallel Environment
11335 Link an application written to use message passing with special startup code to enable the application to run.
11336 The system must have PE installed in the standard location
11337 .Pa ( /usr/lpp/ppe.poe/ ) ,
11340 file must be overridden with the
11342 option to specify the appropriate directory location.
11343 The Parallel Environment does not support threads, so the
11347 option are incompatible.
11349 .It Fl malign-natural
11350 .It Fl malign-power
11351 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11353 overrides the ABI-defined alignment of larger types, such as floating-point doubles, on their natural size-based boundary.
11356 instructs GCC to follow the ABI-specified alignment rules.
11357 GCC defaults to the standard alignment defined in the ABI.
11359 On 64-bit Darwin, natural alignment is the default, and
11365 Generate code that does not use (uses) the floating-point register set.
11366 Software floating point emulation is provided if you use the
11368 option, and pass the option to GCC when linking.
11371 .It Fl mno-multiple
11372 Generate code that uses (does not use) the load multiple word instructions and the store multiple word instructions.
11373 These instructions are generated by default on POWER systems, and not generated on PowerPC systems.
11376 on little endian PowerPC systems, since those instructions do not work when the processor is in little endian mode.
11377 The exceptions are PPC740 and PPC750 which permit the instructions usage in little endian mode.
11381 Generate code that uses (does not use) the load string instructions and the store string word instructions to save multiple registers and do small block moves.
11382 These instructions are generated by default on POWER systems, and not generated on PowerPC systems.
11385 on little endian PowerPC systems, since those instructions do not work when the processor is in little endian mode.
11386 The exceptions are PPC740 and PPC750 which permit the instructions usage in little endian mode.
11390 Generate code that uses (does not use) the load or store instructions that update the base register to the address of the calculated memory location.
11391 These instructions are generated by default.
11394 there is a small window between the time that the stack pointer is updated and the address of the previous frame is stored, which means code that walks the stack frame across interrupts or signals may get corrupted data.
11397 .It Fl mno-fused-madd
11398 Generate code that uses (does not use) the floating point multiply and accumulate instructions.
11399 These instructions are generated by default if hardware floating is used.
11401 .It Fl mno-bit-align
11403 On System V.4 and embedded PowerPC systems do not (do) force structures and unions that contain bit-fields to be aligned to the base type of the bit-field.
11405 For example, by default a structure containing nothing but 8
11407 bit-fields of length 1 would be aligned to a 4 byte boundary and have a size of 4 bytes.
11409 .Fl mno-bit-align ,
11410 the structure would be aligned to a 1 byte boundary and be one byte in size.
11412 .It Fl mno-strict-align
11413 .It Fl mstrict-align
11414 On System V.4 and embedded PowerPC systems do not (do) assume that unaligned memory references will be handled by the system.
11416 .It Fl mrelocatable
11417 .It Fl mno-relocatable
11418 On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime.
11421 on any module, all objects linked together must be compiled with
11424 .Fl mrelocatable-lib .
11426 .It Fl mrelocatable-lib
11427 .It Fl mno-relocatable-lib
11428 On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime.
11429 Modules compiled with
11430 .Fl mrelocatable-lib
11431 can be linked with either modules compiled without
11434 .Fl mrelocatable-lib
11435 or with modules compiled with the
11441 On System V.4 and embedded PowerPC systems do not (do) assume that register 2 contains a pointer to a global area pointing to the addresses used in the program.
11444 .It Fl mlittle-endian
11445 On System V.4 and embedded PowerPC systems compile code for the processor in little endian mode.
11448 option is the same as
11453 On System V.4 and embedded PowerPC systems compile code for the processor in big endian mode.
11456 option is the same as
11459 .It Fl mdynamic-no-pic
11460 On Darwin and Mac OS X systems, compile code so that it is not relocatable, but that its external references are relocatable.
11461 The resulting code is suitable for applications, but not shared libraries.
11463 .It Fl mprioritize-restricted-insns= Ns Ar priority
11464 This option controls the priority that is assigned to dispatch-slot restricted instructions during the second scheduling pass.
11470 .Em no/highest/second-highest
11471 priority to dispatch slot restricted instructions.
11473 .It Fl msched-costly-dep= Ns Ar dependence_type
11474 This option controls which dependences are considered costly by the target during instruction scheduling.
11476 .Em dependence_type
11477 takes one of the following values:
11479 no dependence is costly,
11481 all dependences are costly,
11482 .Em true_store_to_load :
11483 a true dependence from store to load is costly,
11484 .Em store_to_load :
11485 any dependence from store to load is costly,
11487 any dependence which latency \*[Gt]=
11491 .It Fl minsert-sched-nops= Ns Ar scheme
11492 This option controls which nop insertion scheme will be used during the second scheduling pass.
11495 takes one of the following values:
11499 Pad with nops any dispatch group which has vacant issue slots, according to the scheduler's grouping.
11500 .Em regroup_exact :
11501 Insert nops to force costly dependent insns into separate groups.
11502 Insert exactly as many nops as needed to force an insn to a new group, according to the estimated processor grouping.
11504 Insert nops to force costly dependent insns into separate groups.
11507 nops to force an insn to a new group.
11510 On System V.4 and embedded PowerPC systems compile code using calling conventions that adheres to the March 1995 draft of the System V Application Binary Interface, PowerPC processor supplement.
11511 This is the default unless you configured GCC using
11512 .Sy powerpc-*-eabiaix .
11514 .It Fl mcall-sysv-eabi
11521 .It Fl mcall-sysv-noeabi
11528 .It Fl mcall-solaris
11529 On System V.4 and embedded PowerPC systems compile code for the Solaris operating system.
11532 On System V.4 and embedded PowerPC systems compile code for the Linux-based GNU system.
11535 On System V.4 and embedded PowerPC systems compile code for the Hurd-based GNU system.
11537 .It Fl mcall-netbsd
11538 On System V.4 and embedded PowerPC systems compile code for the NetBSD operating system.
11540 .It Fl maix-struct-return
11541 Return all structures in memory (as specified by the AIX ABI).
11543 .It Fl msvr4-struct-return
11544 Return structures smaller than 8 bytes in registers (as specified by the SVR4 ABI).
11546 .It Fl mabi= Ns Ar abi-type
11547 Extend the current ABI with a particular extension, or remove such extension.
11553 .Em ibmlongdouble ,
11554 .Em ieeelongdouble .
11557 Extend the current ABI with SPE ABI extensions.
11558 This does not change the default ABI, instead it adds the SPE ABI extensions to the current ABI.
11561 Disable Booke SPE ABI extensions for the current ABI.
11563 .It Fl mabi=ibmlongdouble
11564 Change the current ABI to use IBM extended precision long double.
11565 This is a PowerPC 32-bit SYSV ABI option.
11567 .It Fl mabi=ieeelongdouble
11568 Change the current ABI to use IEEE extended precision long double.
11569 This is a PowerPC 32-bit Linux ABI option.
11572 .It Fl mno-prototype
11573 On System V.4 and embedded PowerPC systems assume that all calls to variable argument functions are properly prototyped.
11574 Otherwise, the compiler must insert an instruction before every non prototyped call to set or clear bit 6 of the condition code register
11576 to indicate whether floating point values were passed in the floating point registers in case the function takes a variable arguments.
11579 only calls to prototyped variable argument functions will set or clear the bit.
11582 On embedded PowerPC systems, assume that the startup module is called
11584 and that the standard C libraries are
11588 This is the default for
11589 .Sy powerpc-*-eabisim .
11593 On embedded PowerPC systems, assume that the startup module is called
11595 and the standard C libraries are
11601 On embedded PowerPC systems, assume that the startup module is called
11603 and the standard C libraries are
11608 .It Fl myellowknife
11609 On embedded PowerPC systems, assume that the startup module is called
11611 and the standard C libraries are
11617 On System V.4 and embedded PowerPC systems, specify that you are compiling for a VxWorks system.
11620 Specify that you are compiling for the WindISS simulation environment.
11623 On embedded PowerPC systems, set the
11625 bit in the ELF flags header to indicate that
11627 extended relocations are used.
11631 On System V.4 and embedded PowerPC systems do (do not) adhere to the Embedded Applications Binary Interface (eabi) which is a set of modifications to the System V.4 specifications.
11634 means that the stack is aligned to an 8 byte boundary, a function
11638 to set up the eabi environment, and the
11640 option can use both
11644 to point to two separate small data areas.
11647 means that the stack is aligned to a 16 byte boundary, do not call an initialization function from
11651 option will only use
11653 to point to a single small data area.
11656 option is on by default if you configured GCC using one of the
11657 .Sy powerpc*-*-eabi*
11661 On System V.4 and embedded PowerPC systems, put small initialized
11663 global and static data in the
11665 section, which is pointed to by register
11667 Put small initialized non-
11669 global and static data in the
11671 section, which is pointed to by register
11673 Put small uninitialized global and static data in the
11675 section, which is adjacent to the
11680 option is incompatible with the
11685 option also sets the
11690 On System V.4 and embedded PowerPC systems, put small global and static data in the
11692 section, which is pointed to by register
11694 Put small uninitialized global and static data in the
11696 section, which is adjacent to the
11701 option is incompatible with the
11705 .It Fl msdata=default
11707 On System V.4 and embedded PowerPC systems, if
11709 is used, compile code the same as
11711 otherwise compile code the same as
11715 On System V.4 and embedded PowerPC systems, put small global and static data in the
11718 Put small uninitialized global and static data in the
11721 Do not use register
11723 to address small data however.
11724 This is the default behavior unless other
11730 On embedded PowerPC systems, put all initialized global and static data in the
11732 section, and all uninitialized data in the
11737 On embedded PowerPC systems, put global and static items less than or equal to
11739 bytes into the small data or bss sections instead of the normal data or bss section.
11745 switch is also passed to the linker.
11746 All modules should be compiled with the same
11751 .It Fl mno-regnames
11752 On System V.4 and embedded PowerPC systems do (do not) emit register names in the assembly language output using symbolic forms.
11755 .It Fl mno-longcall
11756 Default to making all function calls indirectly, using a register, so that functions which reside further than 32 megabytes (33,554,432 bytes) from the current location can be called.
11757 This setting can be overridden by the
11759 function attribute, or by
11760 .Va #pragma longcall(0) .
11762 Some linkers are capable of detecting out-of-range calls and generating glue code on the fly.
11763 On these systems, long calls are unnecessary and generate slower code.
11764 As of this writing, the AIX linker can do this, as can the GNU linker for PowerPC/64.
11765 It is planned to add this feature to the GNU linker for 32-bit PowerPC systems as well.
11767 On Darwin/PPC systems,
11768 .Va #pragma longcall
11769 will generate "jbsr callee, L42", plus a "branch island" (glue code).
11770 The two target addresses represent the callee and the "branch island".
11771 The Darwin/PPC linker will prefer the first address and generate a "bl callee" if the PPC "bl" instruction will reach the callee directly; otherwise, the linker will generate "bl L42" to call the "branch island".
11772 The "branch island" is appended to the body of the calling function; it computes the full 32-bit address of the callee and jumps to it.
11774 On Mach-O (Darwin) systems, this option directs the compiler emit to the glue for every direct call, and the Darwin linker decides whether to use or discard it.
11776 In the future, we may cause GCC to ignore all longcall specifications when the linker is known to generate glue.
11779 Adds support for multithreading with the
11782 This option sets flags for both the preprocessor and linker.
11785 .It Sy S/390 and zSeries Options
11788 options defined for the S/390 and zSeries architecture.
11793 Use (do not use) the hardware floating-point instructions and registers for floating-point operations.
11796 is specified, functions in
11798 will be used to perform floating-point operations.
11801 is specified, the compiler generates IEEE floating-point instructions.
11802 This is the default.
11804 .It Fl mlong-double-64
11805 .It Fl mlong-double-128
11806 These switches control the size of
11809 A size of 64bit makes the
11811 type equivalent to the
11814 This is the default.
11817 .It Fl mno-backchain
11818 Store (do not store) the address of the caller's frame as backchain pointer into the callee's stack frame.
11819 A backchain may be needed to allow debugging using tools that do not understand DWARF-2 call frame information.
11821 .Fl mno-packed-stack
11822 is in effect, the backchain pointer is stored at the bottom of the stack frame; when
11824 is in effect, the backchain is placed into the topmost word of the 96/160 byte register save area.
11826 In general, code compiled with
11828 is call-compatible with code compiled with
11829 .Fl mmo-backchain ;
11830 however, use of the backchain for debugging purposes usually requires that the whole binary is built with
11832 Note that the combination of
11838 In order to build a linux kernel use
11841 The default is to not maintain the backchain.
11843 .It Fl mpacked-stack
11844 .It Fl mno-packed-stack
11845 Use (do not use) the packed stack layout.
11847 .Fl mno-packed-stack
11848 is specified, the compiler uses the all fields of the 96/160 byte register save area only for their default purpose; unused fields still take up stack space.
11851 is specified, register save slots are densely packed at the top of the register save area; unused space is reused for other purposes, allowing for more efficient use of the available stack space.
11854 is also in effect, the topmost word of the save area is always used to store the backchain, and the return address register is always saved two words below the backchain.
11856 As long as the stack frame backchain is not used, code generated with
11858 is call-compatible with code generated with
11859 .Fl mno-packed-stack .
11860 Note that some non-FSF releases of GCC 2.95 for S/390 or zSeries generated code that uses the stack frame backchain at run time, not just for debugging purposes.
11861 Such code is not call-compatible with code compiled with
11862 .Fl mpacked-stack .
11863 Also, note that the combination of
11869 In order to build a linux kernel use
11872 The default is to not use the packed stack layout.
11875 .It Fl mno-small-exec
11876 Generate (or do not generate) code using the
11878 instruction to do subroutine calls.
11879 This only works reliably if the total executable size does not exceed 64k.
11880 The default is to use the
11882 instruction instead, which does not have this limitation.
11888 is specified, generate code compliant to the GNU/Linux for S/390 ABI.
11891 is specified, generate code compliant to the GNU/Linux for zSeries ABI.
11892 This allows GCC in particular to generate 64-bit instructions.
11895 targets, the default is
11906 is specified, generate code using the instructions available on z/Architecture.
11909 is specified, generate code using the instructions available on ESA/390.
11912 is not possible with
11914 When generating code compliant to the GNU/Linux for S/390 ABI, the default is
11916 When generating code compliant to the GNU/Linux for zSeries ABI, the default is
11921 Generate (or do not generate) code using the
11923 instruction to perform block moves.
11926 is specified, use a
11929 This is the default unless optimizing for size.
11933 Print (or do not print) additional debug information when compiling.
11934 The default is to not print debug information.
11936 .It Fl march= Ns Ar cpu-type
11937 Generate code that will run on
11939 which is the name of a system representing a certain processor type.
11940 Possible values for
11948 When generating code using the instructions available on z/Architecture, the default is
11950 Otherwise, the default is
11953 .It Fl mtune= Ns Ar cpu-type
11956 everything applicable about the generated code, except for the ABI and the set of available instructions.
11959 values is the same as for
11961 The default is the value used for
11965 .It Fl mno-tpf-trace
11966 Generate code that adds (does not add) in TPF OS specific branches to trace routines in the operating system.
11967 This option is off by default, even when compiling for the TPF OS.
11970 .It Fl mno-fused-madd
11971 Generate code that uses (does not use) the floating point multiply and accumulate instructions.
11972 These instructions are generated by default if hardware floating point is used.
11974 .It Fl mwarn-framesize= Ns Ar framesize
11975 Emit a warning if the current function exceeds the given frame size.
11976 Because this is a compile time check it doesn't need to be a real problem when the program runs.
11977 It is intended to identify functions which most probably cause a stack overflow.
11978 It is useful to be used in an environment with limited stack size e.g. the linux kernel.
11980 .It Fl mwarn-dynamicstack
11981 Emit a warning if the function calls alloca or uses dynamically sized arrays.
11982 This is generally a bad idea with a limited stack size.
11984 .It Fl mstack-guard= Ns Ar stack-guard
11985 .It Fl mstack-size= Ns Ar stack-size
11986 These arguments always have to be used in conjunction.
11987 If they are present the s390 back end emits additional instructions in the function prologue which trigger a trap if the stack size is
11991 (remember that the stack on s390 grows downward).
11992 These options are intended to be used to help debugging stack overflow problems.
11993 The additionally emitted code causes only little overhead and hence can also be used in production like systems without greater performance degradation.
11994 The given values have to be exact powers of 2 and
11996 has to be greater than
11998 without exceeding 64k.
11999 In order to be efficient the extra code makes the assumption that the stack starts at an address aligned to the value given by
12006 options are defined for the SH implementations:
12010 Generate code for the SH1.
12013 Generate code for the SH2.
12016 Generate code for the SH2e.
12019 Generate code for the SH3.
12022 Generate code for the SH3e.
12025 Generate code for the SH4 without a floating-point unit.
12027 .It Fl m4-single-only
12028 Generate code for the SH4 with a floating-point unit that only supports single-precision arithmetic.
12031 Generate code for the SH4 assuming the floating-point unit is in single-precision mode by default.
12034 Generate code for the SH4.
12037 Generate code for the SH4al-dsp, or for a SH4a in such a way that the floating-point unit is not used.
12039 .It Fl m4a-single-only
12040 Generate code for the SH4a, in such a way that no double-precision floating point operations are used.
12043 Generate code for the SH4a assuming the floating-point unit is in single-precision mode by default.
12046 Generate code for the SH4a.
12051 except that it implicitly passes
12054 GCC doesn't generate any DSP instructions at the moment.
12057 Compile code for the processor in big endian mode.
12060 Compile code for the processor in little endian mode.
12063 Align doubles at 64-bit boundaries.
12064 Note that this changes the calling conventions, and thus some functions from the standard C library will not work unless you recompile it first with
12068 Shorten some address references at link time, when possible; uses the linker option
12072 Use 32-bit offsets in
12075 The default is to use 16-bit offsets.
12078 Enable the use of the instruction
12082 Comply with the calling conventions defined by Renesas.
12085 Comply with the calling conventions defined by Renesas.
12088 Comply with the calling conventions defined for GCC before the Renesas conventions were available.
12089 This option is the default for all targets of the SH toolchain except for
12090 .Sy sh-symbianelf .
12095 register as call-clobbered, even if
12100 Increase IEEE-compliance of floating-point code.
12101 At the moment, this is equivalent to
12102 .Fl fno-finite-math-only .
12103 When generating 16 bit SH opcodes, getting IEEE-conforming results for comparisons of NANs / infinities incurs extra overhead in every floating point comparison, therefore the default is set to
12104 .Fl ffinite-math-only .
12107 Dump instruction size and location in the assembly code.
12110 This option is deprecated.
12111 It pads structures to multiple of 4 bytes, which is incompatible with the SH ABI.
12114 Optimize for space instead of speed.
12119 When generating position-independent code, emit function calls using the Global Offset Table instead of the Procedure Linkage Table.
12122 Generate a library function call to invalidate instruction cache entries, after fixing up a trampoline.
12123 This library function call doesn't assume it can write to the whole memory address space.
12124 This is the default when the target is
12127 .It Fl multcost= Ns Ar number
12128 Set the cost to assume for a multiply insn.
12130 .It Fl mdiv= Ns Ar strategy
12131 Set the division strategy to use for SHmedia code.
12133 must be one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call, inv:call2, inv:fp.
12134 "fp" performs the operation in floating point.
12135 This has a very high latency, but needs only a few instructions, so it might be a good choice if your code has enough easily exploitable ILP to allow the compiler to schedule the floating point instructions together with other instructions.
12136 Division by zero causes a floating point exception.
12137 "inv" uses integer operations to calculate the inverse of the divisor, and then multiplies the dividend with the inverse.
12138 This strategy allows cse and hoisting of the inverse calculation.
12139 Division by zero calculates an unspecified result, but does not trap.
12140 "inv:minlat" is a variant of "inv" where if no cse / hoisting opportunities have been found, or if the entire operation has been hoisted to the same place, the last stages of the inverse calculation are intertwined with the final multiply to reduce the overall latency, at the expense of using a few more instructions, and thus offering fewer scheduling opportunities with other code.
12141 "call" calls a library function that usually implements the inv:minlat strategy.
12142 This gives high code density for m5-*media-nofpu compilations.
12143 "call2" uses a different entry point of the same library function, where it assumes that a pointer to a lookup table has already been set up, which exposes the pointer load to cse / code hoisting optimizations.
12144 "inv:call", "inv:call2" and "inv:fp" all use the "inv" algorithm for initial code generation, but if the code stays unoptimized, revert to the "call", "call2", or "fp" strategies, respectively.
12145 Note that the potentially-trapping side effect of division by zero is carried by a separate instruction, so it is possible that all the integer instructions are hoisted out, but the marker for the side effect stays where it is.
12146 A recombination to fp operations or a call is not possible in that case.
12147 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.
12148 In the case that the inverse calculation was nor separated from the multiply, they speed up division where the dividend fits into 20 bits (plus sign where applicable), by inserting a test to skip a number of operations in this case; this test slows down the case of larger dividends.
12149 inv20u assumes the case of a such a small dividend to be unlikely, and inv20l assumes it to be likely.
12151 .It Fl mdivsi3_libfunc= Ns Ar name
12152 Set the name of the library function used for 32 bit signed division to
12154 This only affect the name used in the call and inv:call division strategies, and the compiler will still expect the same sets of input/output/clobbered registers as if this option was not present.
12156 .It Fl madjust-unroll
12157 Throttle unrolling to avoid thrashing target registers.
12158 This option only has an effect if the gcc code base supports the TARGET_ADJUST_UNROLL_MAX target hook.
12160 .It Fl mindexed-addressing
12161 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12162 This is only safe if the hardware and/or OS implement 32 bit wrap-around semantics for the indexed addressing mode.
12163 The architecture allows the implementation of processors with 64 bit MMU, which the OS could use to get 32 bit addressing, but since no current hardware implementation supports this or any other way to make the indexed addressing mode safe to use in the 32 bit ABI, the default is -mno-indexed-addressing.
12165 .It Fl mgettrcost= Ns Ar number
12166 Set the cost assumed for the gettr instruction to
12168 The default is 2 if
12170 is in effect, 100 otherwise.
12173 Assume pt* instructions won't trap.
12174 This will generally generate better scheduled code, but is unsafe on current hardware.
12175 The current architecture definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12176 This has the unintentional effect of making it unsafe to schedule ptabs / ptrel before a branch, or hoist it out of a loop.
12177 For example, __do_global_ctors, a part of libgcc that runs constructors at program startup, calls functions in a list which is delimited by -1.
12178 With the -mpt-fixed option, the ptabs will be done before testing against -1.
12179 That means that all the constructors will be run a bit quicker, but when the loop comes to the end of the list, the program crashes because ptabs loads -1 into a target register.
12180 Since this option is unsafe for any hardware implementing the current architecture specification, the default is -mno-pt-fixed.
12181 Unless the user specifies a specific cost with
12183 -mno-pt-fixed also implies
12184 .Fl mgettrcost=100 ;
12185 this deters register allocation using target registers for storing ordinary integers.
12187 .It Fl minvalid-symbols
12188 Assume symbols might be invalid.
12189 Ordinary function symbols generated by the compiler will always be valid to load with movi/shori/ptabs or movi/shori/ptrel, but with assembler and/or linker tricks it is possible to generate symbols that will cause ptabs / ptrel to trap.
12190 This option is only meaningful when
12193 It will then prevent cross-basic-block cse, hoisting and most scheduling of symbol loads.
12195 .Fl mno-invalid-symbols .
12198 .It Sy SPARC Options
12201 options are supported on the SPARC:
12204 .It Fl mno-app-regs
12208 to generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications.
12209 This is the default.
12211 To be fully SVR4 ABI compliant at the cost of some performance loss, specify
12213 You should compile libraries and system software with this option.
12217 Generate output containing floating point instructions.
12218 This is the default.
12222 Generate output containing library calls for floating point.
12224 the requisite libraries are not available for all SPARC targets.
12225 Normally the facilities of the machine's usual C compiler are used, but this cannot be done directly in cross-compilation.
12226 You must make your own arrangements to provide suitable library functions for cross-compilation.
12227 The embedded targets
12231 do provide software floating point support.
12234 changes the calling convention in the output file; therefore, it is only useful if you compile
12236 of a program with this option.
12237 In particular, you need to compile
12239 the library that comes with GCC, with
12241 in order for this to work.
12243 .It Fl mhard-quad-float
12244 Generate output containing quad-word (long double) floating point instructions.
12246 .It Fl msoft-quad-float
12247 Generate output containing library calls for quad-word (long double) floating point instructions.
12248 The functions called are those specified in the SPARC ABI.
12249 This is the default.
12251 As of this writing, there are no SPARC implementations that have hardware support for the quad-word floating point instructions.
12252 They all invoke a trap handler for one of these instructions, and then the trap handler emulates the effect of the instruction.
12253 Because of the trap handler overhead, this is much slower than calling the ABI library routines.
12255 .Fl msoft-quad-float
12256 option is the default.
12258 .It Fl mno-unaligned-doubles
12259 .It Fl munaligned-doubles
12260 Assume that doubles have 8 byte alignment.
12261 This is the default.
12264 .Fl munaligned-doubles ,
12265 GCC assumes that doubles have 8 byte alignment only if they are contained in another type, or if they have an absolute address.
12266 Otherwise, it assumes they have 4 byte alignment.
12267 Specifying this option avoids some rare compatibility problems with code generated by other compilers.
12268 It is not the default because it results in a performance loss, especially for floating point code.
12270 .It Fl mno-faster-structs
12271 .It Fl mfaster-structs
12273 .Fl mfaster-structs ,
12274 the compiler assumes that structures should have 8 byte alignment.
12275 This enables the use of pairs of
12279 instructions for copies in structure assignment, in place of twice as many
12284 However, the use of this changed alignment directly violates the SPARC ABI.
12285 Thus, it's intended only for use on targets where the developer acknowledges that their resulting code will not be directly in line with the rules of the ABI.
12287 .It Fl mimpure-text
12289 used in addition to
12291 tells the compiler to not pass
12293 to the linker when linking a shared object.
12294 Using this option, you can link position-dependent code into a shared object.
12297 suppresses the "relocations remain against allocatable but non-writable sections" linker error message.
12298 However, the necessary relocations will trigger copy-on-write, and the shared object is not actually shared across processes.
12301 you should compile all source code with
12306 This option is only available on SunOS and Solaris.
12308 .It Fl mcpu= Ns Ar cpu_type
12309 Set the instruction set, register set, and instruction scheduling parameters for machine type
12311 Supported values for
12330 Default instruction scheduling parameters are used for values that select an architecture and not an implementation.
12338 Here is a list of each supported architecture and their supported implementations.
12340 .Bd -literal -offset indent
12342 v8: supersparc, hypersparc
12343 sparclite: f930, f934, sparclite86x
12345 v9: ultrasparc, ultrasparc3
12347 By default (unless configured otherwise), GCC generates code for the V7 variant of the SPARC architecture.
12350 the compiler additionally optimizes it for the Cypress CY7C602 chip, as used in the SPARCStation/SPARCServer 3xx series.
12351 This is also appropriate for the older SPARCStation 1, 2, IPX etc.
12355 GCC generates code for the V8 variant of the SPARC architecture.
12356 The only difference from V7 code is that the compiler emits the integer multiply and integer divide instructions which exist in SPARC-V8 but not in SPARC-V7.
12358 .Fl mcpu=supersparc ,
12359 the compiler additionally optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and 2000 series.
12362 .Fl mcpu=sparclite ,
12363 GCC generates code for the SPARClite variant of the SPARC architecture.
12364 This adds the integer multiply, integer divide step and scan
12366 instructions which exist in SPARClite but not in SPARC-V7.
12369 the compiler additionally optimizes it for the Fujitsu MB86930 chip, which is the original SPARClite, with no FPU.
12372 the compiler additionally optimizes it for the Fujitsu MB86934 chip, which is the more recent SPARClite with FPU.
12375 .Fl mcpu=sparclet ,
12376 GCC generates code for the SPARClet variant of the SPARC architecture.
12377 This adds the integer multiply, multiply/accumulate, integer divide step and scan
12379 instructions which exist in SPARClet but not in SPARC-V7.
12382 the compiler additionally optimizes it for the TEMIC SPARClet chip.
12386 GCC generates code for the V9 variant of the SPARC architecture.
12387 This adds 64-bit integer and floating-point move instructions, 3 additional floating-point condition code registers and conditional move instructions.
12389 .Fl mcpu=ultrasparc ,
12390 the compiler additionally optimizes it for the Sun UltraSPARC I/II chips.
12392 .Fl mcpu=ultrasparc3 ,
12393 the compiler additionally optimizes it for the Sun UltraSPARC III chip.
12395 .It Fl mtune= Ns Ar cpu_type
12396 Set the instruction scheduling parameters for machine type
12398 but do not set the instruction set or register set that the option
12399 .Fl mcpu= Ns Ar cpu_type
12402 The same values for
12403 .Fl mcpu= Ns Ar cpu_type
12405 .Fl mtune= Ns Ar cpu_type ,
12406 but the only useful values are those that select a particular cpu implementation.
12423 GCC generates code for the SPARC-V8+ ABI.
12424 The difference from the V8 ABI is that the global and out registers are considered 64-bit wide.
12425 This is enabled by default on Solaris in 32-bit mode for all SPARC-V9 processors.
12431 GCC generates code that takes advantage of the UltraSPARC Visual Instruction Set extensions.
12438 options are supported in addition to the above on SPARC-V9 processors in 64-bit environments:
12441 .It Fl mlittle-endian
12442 Generate code for a processor running in little-endian mode.
12443 It is only available for a few configurations and most notably not on Solaris and Linux.
12447 Generate code for a 32-bit or 64-bit environment.
12448 The 32-bit environment sets int, long and pointer to 32 bits.
12449 The 64-bit environment sets int to 32 bits and long and pointer to 64 bits.
12451 .It Fl mcmodel=medlow
12452 Generate code for the Medium/Low code model: 64-bit addresses, programs must be linked in the low 32 bits of memory.
12453 Programs can be statically or dynamically linked.
12455 .It Fl mcmodel=medmid
12456 Generate code for the Medium/Middle code model: 64-bit addresses, programs must be linked in the low 44 bits of memory, the text and data segments must be less than 2GB in size and the data segment must be located within 2GB of the text segment.
12458 .It Fl mcmodel=medany
12459 Generate code for the Medium/Anywhere code model: 64-bit addresses, programs may be linked anywhere in memory, the text and data segments must be less than 2GB in size and the data segment must be located within 2GB of the text segment.
12461 .It Fl mcmodel=embmedany
12462 Generate code for the Medium/Anywhere code model for embedded systems: 64-bit addresses, the text and data segments must be less than 2GB in size, both starting anywhere in memory (determined at link time).
12463 The global register %g4 points to the base of the data segment.
12464 Programs are statically linked and PIC is not supported.
12467 .It Fl mno-stack-bias
12470 GCC assumes that the stack pointer, and frame pointer if present, are offset by -2047 which must be added back when making stack frame references.
12471 This is the default in 64-bit mode.
12472 Otherwise, assume no such offset is present.
12475 These switches are supported in addition to the above on Solaris:
12479 Add support for multithreading using the Solaris threads library.
12480 This option sets flags for both the preprocessor and linker.
12481 This option does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it.
12484 Add support for multithreading using the POSIX threads library.
12485 This option sets flags for both the preprocessor and linker.
12486 This option does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it.
12489 This is a synonym for
12493 .It Sy Options for System V
12494 These additional options are available on System V Release 4 for compatibility with other compilers on those systems:
12498 Create a shared object.
12499 It is recommended that
12506 Identify the versions of each tool used by the compiler, in a
12508 assembler directive in the output.
12511 Refrain from adding
12513 directives to the output file (this is the default).
12515 .It Fl YP, Ns Ar dirs
12516 Search the directories
12518 and no others, for libraries specified with
12521 .It Fl Ym, Ns Ar dir
12522 Look in the directory
12524 to find the M4 preprocessor.
12525 The assembler uses this option.
12528 .It Sy TMS320C3x/C4x Options
12531 options are defined for TMS320C3x/C4x implementations:
12534 .It Fl mcpu= Ns Ar cpu_type
12535 Set the instruction set, register set, and instruction scheduling parameters for machine type
12537 Supported values for
12548 to generate code for the TMS320C40.
12552 .It Fl msmall-memory
12554 Generates code for the big or small memory model.
12555 The small memory model assumed that all data fits into one 64K word page.
12556 At run-time the data page (DP) register must be set to point to the 64K page containing the .bss and .data program sections.
12557 The big memory model is the default and requires reloading of the DP register for every direct memory access.
12561 Allow (disallow) allocation of general integer operands into the block count register BK.
12565 Enable (disable) generation of code using decrement and branch, DBcond(D), instructions.
12566 This is enabled by default for the C4x.
12567 To be on the safe side, this is disabled for the C3x, since the maximum iteration count on the C3x is 2^{23 + 1} (but who iterates loops more than 2^{23} times on the C3x?).
12568 Note that GCC will try to reverse a loop so that it can utilize the decrement and branch instruction, but will give up if there is more than one memory reference in the loop.
12569 Thus a loop where the loop counter is decremented can generate slightly more efficient code, in cases where the RPTB instruction cannot be utilized.
12571 .It Fl mdp-isr-reload
12573 Force the DP register to be saved on entry to an interrupt service routine (ISR), reloaded to point to the data section, and restored on exit from the ISR.
12574 This should not be required unless someone has violated the small memory model by modifying the DP register, say within an object library.
12578 For the C3x use the 24-bit MPYI instruction for integer multiplies instead of a library call to guarantee 32-bit results.
12579 Note that if one of the operands is a constant, then the multiplication will be performed using shifts and adds.
12582 option is not specified for the C3x, then squaring operations are performed inline instead of a library call.
12585 .It Fl mno-fast-fix
12586 The C3x/C4x FIX instruction to convert a floating point value to an integer value chooses the nearest integer less than or equal to the floating point value rather than to the nearest integer.
12587 Thus if the floating point number is negative, the result will be incorrectly truncated an additional code is necessary to detect and correct this case.
12588 This option can be used to disable generation of the additional code required to correct the result.
12592 Enable (disable) generation of repeat block sequences using the RPTB instruction for zero overhead looping.
12593 The RPTB construct is only used for innermost loops that do not call functions or jump across the loop boundaries.
12594 There is no advantage having nested RPTB loops due to the overhead required to save and restore the RC, RS, and RE registers.
12595 This is enabled by default with
12598 .It Fl mrpts= Ns Ar count
12600 Enable (disable) the use of the single instruction repeat instruction RPTS.
12601 If a repeat block contains a single instruction, and the loop count can be guaranteed to be less than the value
12603 GCC will emit a RPTS instruction instead of a RPTB.
12604 If no value is specified, then a RPTS will be emitted even if the loop count cannot be determined at compile time.
12605 Note that the repeated instruction following RPTS does not have to be reloaded from memory each iteration, thus freeing up the CPU buses for operands.
12606 However, since interrupts are blocked by this instruction, it is disabled by default.
12608 .It Fl mloop-unsigned
12609 .It Fl mno-loop-unsigned
12610 The maximum iteration count when using RPTS and RPTB (and DB on the C40) is 2^{31 + 1} since these instructions test if the iteration count is negative to terminate the loop.
12611 If the iteration count is unsigned there is a possibility than the 2^{31 + 1} maximum iteration count may be exceeded.
12612 This switch allows an unsigned iteration count.
12615 Try to emit an assembler syntax that the TI assembler (asm30) is happy with.
12616 This also enforces compatibility with the API employed by the TI C3x C compiler.
12617 For example, long doubles are passed as structures rather than in floating point registers.
12621 Generate code that uses registers (stack) for passing arguments to functions.
12622 By default, arguments are passed in registers where possible rather than by pushing arguments on to the stack.
12624 .It Fl mparallel-insns
12625 .It Fl mno-parallel-insns
12626 Allow the generation of parallel instructions.
12627 This is enabled by default with
12630 .It Fl mparallel-mpy
12631 .It Fl mno-parallel-mpy
12632 Allow the generation of MPY||ADD and MPY||SUB parallel instructions, provided
12633 .Fl mparallel-insns
12635 These instructions have tight register constraints which can pessimize the code generation of large functions.
12638 .It Sy V850 Options
12641 options are defined for V850 implementations:
12645 .It Fl mno-long-calls
12646 Treat all calls as being far away (near).
12647 If calls are assumed to be far away, the compiler will always load the functions address up into a register, and call indirect through the pointer.
12651 Do not optimize (do optimize) basic blocks that use the same index pointer 4 or more times to copy pointer into the
12653 register, and use the shorter
12660 option is on by default if you optimize.
12662 .It Fl mno-prolog-function
12663 .It Fl mprolog-function
12664 Do not use (do use) external functions to save and restore registers at the prologue and epilogue of a function.
12665 The external functions are slower, but use less code space if more than one function saves the same number of registers.
12667 .Fl mprolog-function
12668 option is on by default if you optimize.
12671 Try to make the code as small as possible.
12672 At present, this just turns on the
12675 .Fl mprolog-function
12678 .It Fl mtda= Ns Ar n
12679 Put static or global variables whose size is
12681 bytes or less into the tiny data area that register
12684 The tiny data area can hold up to 256 bytes in total (128 bytes for byte references).
12686 .It Fl msda= Ns Ar n
12687 Put static or global variables whose size is
12689 bytes or less into the small data area that register
12692 The small data area can hold up to 64 kilobytes.
12694 .It Fl mzda= Ns Ar n
12695 Put static or global variables whose size is
12697 bytes or less into the first 32 kilobytes of memory.
12700 Specify that the target processor is the V850.
12703 Generate code suitable for big switch tables.
12704 Use this option only if the assembler/linker complain about out of range branches within a switch table.
12707 This option will cause r2 and r5 to be used in the code generated by the compiler.
12708 This setting is the default.
12710 .It Fl mno-app-regs
12711 This option will cause r2 and r5 to be treated as fixed registers.
12714 Specify that the target processor is the V850E1.
12715 The preprocessor constants
12719 will be defined if this option is used.
12722 Specify that the target processor is the V850E.
12723 The preprocessor constant
12725 will be defined if this option is used.
12733 are defined then a default target processor will be chosen and the relevant
12735 preprocessor constant will be defined.
12737 The preprocessor constants
12741 are always defined, regardless of which processor variant is the target.
12743 .It Fl mdisable-callt
12744 This option will suppress generation of the CALLT instruction for the v850e and v850e1 flavors of the v850 architecture.
12746 .Fl mno-disable-callt
12747 which allows the CALLT instruction to be used.
12753 options are defined for the VAX:
12757 Do not output certain jump instructions
12759 and so on) that the Unix assembler for the VAX cannot handle across long ranges.
12762 Do output those jump instructions, on the assumption that you will assemble with the GNU assembler.
12765 Output code for g-format floating point numbers instead of d-format.
12768 .It Sy x86-64 Options
12769 These are listed under
12770 .It Sy Xstormy16 Options
12771 These options are defined for Xstormy16:
12775 Choose startup files and linker script suitable for the simulator.
12778 .It Sy Xtensa Options
12779 These options are supported for Xtensa targets:
12784 Enable or disable use of
12786 instructions for loading constant values.
12789 instruction is currently not a standard option from Tensilica.
12792 instructions are always used in place of the standard
12797 is enabled by default only if the
12799 instruction is not available.
12802 .It Fl mno-fused-madd
12803 Enable or disable use of fused multiply/add and multiply/subtract instructions in the floating-point option.
12804 This has no effect if the floating-point option is not also enabled.
12805 Disabling fused multiply/add and multiply/subtract instructions forces the compiler to use separate instructions for the multiply and add/subtract operations.
12806 This may be desirable in some cases where strict IEEE 754-compliant results are required: the fused multiply add/subtract instructions do not round the intermediate result, thereby producing results with
12808 bits of precision than specified by the IEEE standard.
12809 Disabling fused multiply add/subtract instructions also ensures that the program output is not sensitive to the compiler's ability to combine multiply and add/subtract operations.
12811 .It Fl mtext-section-literals
12812 .It Fl mno-text-section-literals
12813 Control the treatment of literal pools.
12815 .Fl mno-text-section-literals ,
12816 which places literals in a separate section in the output file.
12817 This allows the literal pool to be placed in a data RAM/ROM, and it also allows the linker to combine literal pools from separate object files to remove redundant literals and improve code size.
12819 .Fl mtext-section-literals ,
12820 the literals are interspersed in the text section in order to keep them as close as possible to their references.
12821 This may be necessary for large assembly files.
12823 .It Fl mtarget-align
12824 .It Fl mno-target-align
12825 When this option is enabled, GCC instructs the assembler to automatically align instructions to reduce branch penalties at the expense of some code density.
12826 The assembler attempts to widen density instructions to align branch targets and the instructions following call instructions.
12827 If there are not enough preceding safe density instructions to align a target, no widening will be performed.
12829 .Fl mtarget-align .
12830 These options do not affect the treatment of auto-aligned instructions like
12832 which the assembler will always align, either by widening density instructions or by inserting no-op instructions.
12835 .It Fl mno-longcalls
12836 When this option is enabled, GCC instructs the assembler to translate direct calls to indirect calls unless it can determine that the target of a direct call is in the range allowed by the call instruction.
12837 This translation typically occurs for calls to functions in other source files.
12838 Specifically, the assembler translates a direct
12840 instruction into an
12846 .Fl mno-longcalls .
12847 This option should be used in programs where the call target can potentially be out of range.
12848 This option is implemented in the assembler, not the compiler, so the assembly code generated by GCC will still show direct call instructions---look at the disassembled object code to see the actual instructions.
12849 Note that the assembler will use an indirect call for every cross-file call, not just those that really will be out of range.
12852 .It Sy zSeries Options
12853 These are listed under
12855 .Ss Options for Code Generation Conventions
12856 These machine-independent options control the interface conventions used in code generation.
12858 Most of them have both positive and negative forms; the negative form of
12862 In the table below, only one of the forms is listed---the one which is not the default.
12863 You can figure out the other form by either removing
12868 .It Fl fbounds-check
12869 For front-ends that support it, generate additional code to check that indices used to access arrays are within the declared range.
12870 This is currently only supported by the Java and Fortran front-ends, where this option defaults to true and false respectively.
12873 This option generates traps for signed overflow on addition, subtraction, multiplication operations.
12876 This option instructs the compiler to assume that signed arithmetic overflow of addition, subtraction and multiplication wraps around using twos-complement representation.
12877 This flag enables some optimizations and disables others.
12878 This option is enabled by default for the Java front-end, as required by the Java language specification.
12881 Enable exception handling.
12882 Generates extra code needed to propagate exceptions.
12883 For some targets, this implies GCC will generate frame unwind information for all functions, which can produce significant data size overhead, although it does not affect execution.
12884 If you do not specify this option, GCC will enable it by default for languages like C++ which normally require exception handling, and disable it for languages like C that do not normally require it.
12885 However, you may need to enable this option when compiling C code that needs to interoperate properly with exception handlers written in C++.
12886 You may also wish to disable this option if you are compiling older C++ programs that don't use exception handling.
12888 .It Fl fnon-call-exceptions
12889 Generate code that allows trapping instructions to throw exceptions.
12890 Note that this requires platform-specific runtime support that does not exist everywhere.
12891 Moreover, it only allows
12893 instructions to throw exceptions, i.e. memory references or floating point instructions.
12894 It does not allow exceptions to be thrown from arbitrary signal handlers such as
12897 .It Fl funwind-tables
12900 except that it will just generate any needed static data, but will not affect the generated code in any other way.
12901 You will normally not enable this option; instead, a language processor that needs this handling would enable it on your behalf.
12903 .It Fl fasynchronous-unwind-tables
12904 Generate unwind table in dwarf2 format, if supported by target machine.
12905 The table is exact at each instruction boundary, so it can be used for stack unwinding from asynchronous events (such as debugger or garbage collector).
12907 .It Fl fpcc-struct-return
12912 values in memory like longer ones, rather than in registers.
12913 This convention is less efficient, but it has the advantage of allowing intercallability between GCC-compiled files and files compiled with other compilers, particularly the Portable C Compiler (pcc).
12915 The precise convention for returning structures in memory depends on the target configuration macros.
12917 Short structures and unions are those whose size and alignment match that of some integer type.
12920 code compiled with the
12921 .Fl fpcc-struct-return
12922 switch is not binary compatible with code compiled with the
12923 .Fl freg-struct-return
12925 Use it to conform to a non-default application binary interface.
12927 .It Fl freg-struct-return
12932 values in registers when possible.
12933 This is more efficient for small structures than
12934 .Fl fpcc-struct-return .
12936 If you specify neither
12937 .Fl fpcc-struct-return
12939 .Fl freg-struct-return ,
12940 GCC defaults to whichever convention is standard for the target.
12941 If there is no standard convention, GCC defaults to
12942 .Fl fpcc-struct-return ,
12943 except on targets where GCC is the principal compiler.
12944 In those cases, we can choose the standard, and we chose the more efficient register return alternative.
12947 code compiled with the
12948 .Fl freg-struct-return
12949 switch is not binary compatible with code compiled with the
12950 .Fl fpcc-struct-return
12952 Use it to conform to a non-default application binary interface.
12954 .It Fl fshort-enums
12957 type only as many bytes as it needs for the declared range of possible values.
12960 type will be equivalent to the smallest integer type which has enough room.
12965 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
12966 Use it to conform to a non-default application binary interface.
12968 .It Fl fshort-double
12969 Use the same size for
12977 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
12978 Use it to conform to a non-default application binary interface.
12980 .It Fl fshort-wchar
12981 Override the underlying type for
12984 .Sy short unsigned int
12985 instead of the default for the target.
12986 This option is useful for building programs to run under WINE.
12991 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
12992 Use it to conform to a non-default application binary interface.
12994 .It Fl fshared-data
12995 Requests that the data and non-
12997 variables of this compilation be shared data rather than private data.
12998 The distinction makes sense only on certain operating systems, where shared data is shared between processes running the same program, while private data exists in one copy per process.
13001 In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks.
13002 This has the effect that if the same variable is declared (without
13004 in two different compilations, you will get an error when you link them.
13005 The only reason this might be useful is if you wish to verify that the program will work on other systems which always work this way.
13012 .It Fl finhibit-size-directive
13015 assembler directive, or anything else that would cause trouble if the function is split in the middle, and the two halves are placed at locations far apart in memory.
13016 This option is used when compiling
13018 you should not need to use it for anything else.
13020 .It Fl fverbose-asm
13021 Put extra commentary information in the generated assembly code to make it more readable.
13022 This option is generally only of use to those who actually need to read the generated assembly code (perhaps while debugging the compiler itself).
13024 .Fl fno-verbose-asm ,
13025 the default, causes the extra information to be omitted and is useful when comparing two assembler files.
13028 Generate position-independent code (PIC) suitable for use in a shared library, if supported for the target machine.
13029 Such code accesses all constant addresses through a global offset table (GOT).
13030 The dynamic loader resolves the GOT entries when the program starts (the dynamic loader is not part of GCC; it is part of the operating system).
13031 If the GOT size for the linked executable exceeds a machine-specific maximum size, you get an error message from the linker indicating that
13033 does not work; in that case, recompile with
13036 (These maximums are 8k on the SPARC and 32k on the m68k and RS/6000.
13037 The 386 has no such limit.)
13039 Position-independent code requires special support, and therefore works only on certain machines.
13040 For the 386, GCC supports PIC for System V but not for the Sun 386i.
13041 Code generated for the IBM RS/6000 is always position-independent.
13044 If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table.
13045 This option makes a difference on the m68k, PowerPC and SPARC.
13047 Position-independent code requires special support, and therefore works only on certain machines.
13051 These options are similar to
13055 but generated position independent code can be only linked into executables.
13056 Usually these options are used when
13058 GCC option will be used during linking.
13060 .It Fl fno-jump-tables
13061 Do not use jump tables for switch statements even where it would be more efficient than other code generation strategies.
13062 This option is of use in conjunction with
13066 for building code which forms part of a dynamic linker and cannot reference the address of a jump table.
13067 On some targets, jump tables do not require a GOT and this option is not needed.
13069 .It Fl ffixed- Ns Ar reg
13070 Treat the register named
13072 as a fixed register; generated code should never refer to it (except perhaps as a stack pointer, frame pointer or in some other fixed role).
13075 must be the name of a register.
13076 The register names accepted are machine-specific and are defined in the
13078 macro in the machine description macro file.
13080 This flag does not have a negative form, because it specifies a three-way choice.
13082 .It Fl fcall-used- Ns Ar reg
13083 Treat the register named
13085 as an allocable register that is clobbered by function calls.
13086 It may be allocated for temporaries or variables that do not live across a call.
13087 Functions compiled this way will not save and restore the register
13090 It is an error to used this flag with the frame pointer or stack pointer.
13091 Use of this flag for other registers that have fixed pervasive roles in the machine's execution model will produce disastrous results.
13093 This flag does not have a negative form, because it specifies a three-way choice.
13095 .It Fl fcall-saved- Ns Ar reg
13096 Treat the register named
13098 as an allocable register saved by functions.
13099 It may be allocated even for temporaries or variables that live across a call.
13100 Functions compiled this way will save and restore the register
13104 It is an error to used this flag with the frame pointer or stack pointer.
13105 Use of this flag for other registers that have fixed pervasive roles in the machine's execution model will produce disastrous results.
13107 A different sort of disaster will result from the use of this flag for a register in which function values may be returned.
13109 This flag does not have a negative form, because it specifies a three-way choice.
13111 .It Sy -fpack-struct[= Ns Em n Ns Sy ] Ns
13112 Without a value specified, pack all structure members together without holes.
13113 When a value is specified (which must be a small power of two), pack structure members according to this value, representing the maximum alignment (that is, objects with default alignment requirements larger than this will be output potentially unaligned at the next fitting location.
13118 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
13119 Additionally, it makes the code suboptimal.
13120 Use it to conform to a non-default application binary interface.
13122 .It Fl finstrument-functions
13123 Generate instrumentation calls for entry and exit to functions.
13124 Just after function entry and just before function exit, the following profiling functions will be called with the address of the current function and its call site.
13125 (On some platforms,
13126 .Va __builtin_return_address
13127 does not work beyond the current function, so the call site information may not be available to the profiling functions otherwise.)
13129 .Bd -literal -offset indent
13130 void __cyg_profile_func_enter (void *this_fn,
13132 void __cyg_profile_func_exit (void *this_fn,
13135 The first argument is the address of the start of the current function, which may be looked up exactly in the symbol table.
13137 This instrumentation is also done for functions expanded inline in other functions.
13138 The profiling calls will indicate where, conceptually, the inline function is entered and exited.
13139 This means that addressable versions of such functions must be available.
13140 If all your uses of a function are expanded inline, this may mean an additional expansion of code size.
13143 in your C code, an addressable version of such functions must be provided.
13144 (This is normally the case anyways, but if you get lucky and the optimizer always expands the functions inline, you might have gotten away without providing static copies.)
13146 A function may be given the attribute
13147 .Va no_instrument_function ,
13148 in which case this instrumentation will not be done.
13149 This can be used, for example, for the profiling functions listed above, high-priority interrupt routines, and any functions from which the profiling functions cannot safely be called (perhaps signal handlers, if the profiling routines generate output or allocate memory).
13151 .It Fl fstack-check
13152 Generate code to verify that you do not go beyond the boundary of the stack.
13153 You should specify this flag if you are running in an environment with multiple threads, but only rarely need to specify it in a single-threaded environment since stack overflow is automatically detected on nearly all systems if there is only one stack.
13155 Note that this switch does not actually cause checking to be done; the operating system must do that.
13156 The switch causes generation of code to ensure that the operating system sees the stack being extended.
13158 .It Fl fstack-limit-register= Ns Ar reg
13159 .It Fl fstack-limit-symbol= Ns Ar sym
13160 .It Fl fno-stack-limit
13161 Generate code to ensure that the stack does not grow beyond a certain value, either the value of a register or the address of a symbol.
13162 If the stack would grow beyond the value, a signal is raised.
13163 For most targets, the signal is raised before the stack overruns the boundary, so it is possible to catch the signal without taking special precautions.
13165 For instance, if the stack starts at absolute address
13167 and grows downwards, you can use the flags
13168 .Fl fstack-limit-symbol=__stack_limit
13170 .Fl Wl,--defsym,__stack_limit=0x7ffe0000
13171 to enforce a stack limit of 128KB.
13172 Note that this may only work with the GNU linker.
13174 .It Fl fargument-alias
13175 .It Fl fargument-noalias
13176 .It Fl fargument-noalias-global
13177 Specify the possible relationships among parameters and between parameters and global data.
13179 .Fl fargument-alias
13180 specifies that arguments (parameters) may alias each other and may alias global storage.
13181 .Fl fargument-noalias
13182 specifies that arguments do not alias each other, but may alias global storage.
13183 .Fl fargument-noalias-global
13184 specifies that arguments do not alias each other and do not alias global storage.
13186 Each language will automatically use whatever option is required by the language standard.
13187 You should not need to use these options yourself.
13189 .It Fl fleading-underscore
13190 This option and its counterpart,
13191 .Fl fno-leading-underscore ,
13192 forcibly change the way C symbols are represented in the object file.
13193 One use is to help link with legacy assembly code.
13197 .Fl fleading-underscore
13198 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
13199 Use it to conform to a non-default application binary interface.
13200 Not all targets provide complete support for this switch.
13202 .It Fl ftls-model= Ns Ar model
13203 Alter the thread-local storage model to be used.
13206 argument should be one of
13207 .Va global-dynamic ,
13208 .Va local-dynamic ,
13213 The default without
13220 .Va global-dynamic .
13222 .It Fl fvisibility= Ns Ar default|internal|hidden|protected
13223 Set the default ELF image symbol visibility to the specified option---all symbols will be marked with this unless overridden within the code.
13224 Using this feature can very substantially improve linking and load times of shared object libraries, produce more optimized code, provide near-perfect API export and prevent symbol clashes.
13227 recommended that you use this in any shared objects you distribute.
13229 Despite the nomenclature,
13231 always means public ie; available to be linked against from outside the shared object.
13235 are pretty useless in real-world usage so the only other commonly used option will be
13241 i.e., make every symbol public---this causes the same behavior as previous versions of GCC.
13243 A good explanation of the benefits offered by ensuring ELF symbols have the correct visibility is given by "How To Write Shared Libraries" by Ulrich Drepper (which can be found at
13244 .Lk http://people.redhat.com/~drepper/ )
13245 ---however a superior solution made possible by this option to marking things hidden when the default is public is to make the default hidden and mark things public.
13246 This is the norm with DLL's on Windows and with
13247 .Fl fvisibility=hidden
13249 .Va __attribute__ ((visibility("default")))
13251 .Va __declspec(dllexport)
13252 you get almost identical semantics with identical syntax.
13253 This is a great boon to those working with cross-platform projects.
13255 For those adding visibility support to existing code, you may find
13256 .Sy #pragma GCC visibility
13258 This works by you enclosing the declarations you wish to set visibility for with (for example)
13259 .Sy #pragma GCC visibility push(hidden)
13261 .Sy #pragma GCC visibility pop .
13262 Bear in mind that symbol visibility should be viewed
13263 .Sy as part of the API interface contract
13264 and thus all new code should always specify visibility when it is not the default ie; declarations only for use within the local DSO should
13266 be marked explicitly as hidden as so to avoid PLT indirection overheads---making this abundantly clear also aids readability and self-documentation of the code.
13267 Note that due to ISO C++ specification requirements, operator new and operator delete must always be of default visibility.
13269 An overview of these techniques, their benefits and how to use them is at
13270 .Lk http://gcc.gnu.org/wiki/Visibility .
13274 This section describes several environment variables that affect how GCC operates.
13275 Some of them work by specifying directories or prefixes to use when searching for various kinds of files.
13276 Some are used to specify other aspects of the compilation environment.
13278 Note that you can also specify places to search using options such as
13283 These take precedence over places specified using environment variables, which in turn take precedence over those specified by the configuration of GCC.
13288 .It Sy LC_MESSAGES Ns
13290 These environment variables control the way that GCC uses localization information that allow GCC to work with different national conventions.
13291 GCC inspects the locale categories
13295 if it has been configured to do so.
13296 These locale categories can be set to any value supported by your installation.
13299 for English in the United Kingdom encoded in UTF-8.
13303 environment variable specifies character classification.
13304 GCC uses it to determine the character boundaries in a string; this is needed for some multibyte encodings that contain quote and escape characters that would otherwise be interpreted as a string end or escape.
13308 environment variable specifies the language to use in diagnostic messages.
13312 environment variable is set, it overrides the value of
13320 default to the value of the
13322 environment variable.
13323 If none of these variables are set, GCC defaults to traditional C English behavior.
13328 is set, it specifies the directory to use for temporary files.
13329 GCC uses temporary files to hold the output of one stage of compilation which is to be used as input to the next stage: for example, the output of the preprocessor, which is the input to the compiler proper.
13331 .It Sy GCC_EXEC_PREFIX Ns
13333 .Sy GCC_EXEC_PREFIX
13334 is set, it specifies a prefix to use in the names of the subprograms executed by the compiler.
13335 No slash is added when this prefix is combined with the name of a subprogram, but you can specify a prefix that ends with a slash if you wish.
13338 .Sy GCC_EXEC_PREFIX
13339 is not set, GCC will attempt to figure out an appropriate prefix to use based on the pathname it was invoked with.
13341 If GCC cannot find the subprogram using the specified prefix, it tries looking in the usual places for the subprogram.
13343 The default value of
13344 .Sy GCC_EXEC_PREFIX
13346 .Pa prefix/lib/gcc/
13355 Other prefixes specified with
13357 take precedence over this prefix.
13359 This prefix is also used for finding files such as
13361 that are used for linking.
13363 In addition, the prefix is used in an unusual way in finding the directories to search for header files.
13364 For each of the standard directories whose name normally begins with
13365 .Sy /usr/local/lib/gcc
13366 (more precisely, with the value of
13367 .Sy GCC_INCLUDE_DIR ) ,
13368 GCC tries replacing that beginning with the specified prefix to produce an alternate directory name.
13373 where it would normally search
13374 .Pa /usr/local/lib/bar .
13375 These alternate directories are searched first; the standard directories come next.
13377 .It Sy COMPILER_PATH Ns
13380 is a colon-separated list of directories, much like
13382 GCC tries the directories thus specified when searching for subprograms, if it can't find the subprograms using
13383 .Sy GCC_EXEC_PREFIX .
13385 .It Sy LIBRARY_PATH Ns
13388 is a colon-separated list of directories, much like
13390 When configured as a native compiler, GCC tries the directories thus specified when searching for special linker files, if it can't find them using
13391 .Sy GCC_EXEC_PREFIX .
13392 Linking using GCC also uses these directories when searching for ordinary libraries for the
13394 option (but directories specified with
13399 This variable is used to pass locale information to the compiler.
13400 One way in which this information is used is to determine the character set to be used when character literals, string literals and comments are parsed in C and C++.
13401 When the compiler is configured to allow multibyte characters, the following values for
13407 Recognize JIS characters.
13410 Recognize SJIS characters.
13413 Recognize EUCJP characters.
13418 is not defined, or if it has some other value, then the compiler will use mblen and mbtowc as defined by the default locale to recognize and translate multibyte characters.
13421 Some additional environments variables affect the behavior of the preprocessor.
13425 .It Sy C_INCLUDE_PATH Ns
13426 .It Sy CPLUS_INCLUDE_PATH Ns
13427 .It Sy OBJC_INCLUDE_PATH Ns
13428 Each variable's value is a list of directories separated by a special character, much like
13430 in which to look for header files.
13431 The special character,
13432 .Va PATH_SEPARATOR ,
13433 is target-dependent and determined at GCC build time.
13434 For Microsoft Windows-based targets it is a semicolon, and for almost all other targets it is a colon.
13437 specifies a list of directories to be searched as if specified with
13439 but after any paths given with
13441 options on the command line.
13442 This environment variable is used regardless of which language is being preprocessed.
13444 The remaining environment variables apply only when preprocessing the particular language indicated.
13445 Each specifies a list of directories to be searched as if specified with
13447 but after any paths given with
13449 options on the command line.
13451 In all these variables, an empty element instructs the compiler to search its current working directory.
13452 Empty elements can appear at the beginning or end of a path.
13453 For instance, if the value of
13456 .Va :/special/include ,
13457 that has the same effect as
13458 .Sy -I. -I/special/include .
13460 .It Sy DEPENDENCIES_OUTPUT Ns
13461 If this variable is set, its value specifies how to output dependencies for Make based on the non-system header files processed by the compiler.
13462 System header files are ignored in the dependency output.
13465 .Sy DEPENDENCIES_OUTPUT
13466 can be just a file name, in which case the Make rules are written to that file, guessing the target name from the source file name.
13467 Or the value can have the form
13471 in which case the rules are written to file
13475 as the target name.
13477 In other words, this environment variable is equivalent to combining the options
13485 .It Sy SUNPRO_DEPENDENCIES Ns
13486 This variable is the same as
13487 .Sy DEPENDENCIES_OUTPUT
13488 (see above), except that system header files are not ignored, so it implies
13492 However, the dependence on the main input file is omitted.
13494 .It Sy CPP_RESTRICTED Ns
13495 If this variable is defined, cpp will skip any include file which is not a regular file, and will continue searching for the requested name (this is always done if the found file is a directory).
13499 For instructions on reporting bugs, see
13500 .Lk http://gcc.gnu.org/bugs.html .
13506 needs to build supplementary stub code for constructors to work.
13507 On multi-libbed systems,
13509 must select the correct support libraries to link against.
13510 Failing to supply the correct flags may lead to subtle defects.
13511 Supplying them in cases where they are not necessary is innocuous.
13515 gpl(7), gfdl(7), fsf-funding(7), cpp(1), gcov(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1) and the Info entries for
13524 See the Info entry for
13527 .Lk http://gcc.gnu.org/onlinedocs/gcc/Contributors.html ,
13528 for contributors to GCC.
13530 Copyright (c) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
13532 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being "GNU General Public License" and "Funding Free Software", the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below).
13533 A copy of the license is included in the gfdl(7) man page.
13535 (a) The FSF's Front-Cover Text is:
13539 (b) The FSF's Back-Cover Text is:
13541 You have freedom to copy and modify this GNU Manual, like GNU software.
13542 Copies published by the Free Software Foundation raise funds for GNU development.