1 .\" $NetBSD: gcc.1,v 1.3 2009/04/30 00:30:56 joerg Exp $
7 .Nd GNU project C and C++ compiler
10 .Oo Fl c | Fl S | Fl E Oc
11 .Op Fl std= Ns Ar standard
15 .Op Fl W Ns Ar warn...
19 .Op Fl D Ns Ar macro Ns = Ns Ar defn...
21 .Op Fl f Ns Ar option...
22 .Op Fl m Ns Ar machine-option...
27 Only the most useful options are listed here; see below for the remainder.
29 accepts mostly the same options as
32 When you invoke GCC, it normally does preprocessing, compilation, assembly and linking.
33 The "overall options" allow you to stop this process at an intermediate stage.
36 option says not to run the linker.
37 Then the output consists of object files output by the assembler.
39 Other options are passed on to one stage of processing.
40 Some options control the preprocessor and others the compiler itself.
41 Yet other options control the assembler and linker; most of these are not documented here, since you rarely need to use any of them.
43 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.
44 If the description for a particular option does not mention a source language, you can use that option with all supported languages.
48 program accepts options and file names as operands.
49 Many options have multi-letter names; therefore multiple single-letter options may
53 is very different from
56 You can mix options and other arguments.
57 For the most part, the order you use doesn't matter.
58 Order does matter when you use several options of the same kind; for example, if you specify
60 more than once, the directories are searched in the order specified.
62 Many options have long names starting with
67 .Fl fstrength-reduce ,
70 Most of these have both positive and negative forms; the negative form of
74 This manual documents only one of these two forms, whichever one is not the default.
77 Here is a summary of all the options, grouped by type.
78 Explanations are in the following sections.
81 .It Sy Overall Options
82 .Fl c Fl S Fl E Fl o Ar file
83 .Fl combine Fl pipe Fl pass-exit-codes Fl x Ar language
84 .Fl v Fl ### Fl -help Fl -target-help Fl -version
86 .It Sy C Language Options
87 .Fl ansi Fl std= Ns Ar standard
88 .Fl fgnu89-inline Fl aux-info Ar filename
89 .Fl fno-asm Fl fno-builtin Fl fno-builtin- Ns Ar function
90 .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
92 .It Sy C++ Language Options
93 .Fl fabi-version= Ns Ar n
94 .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
95 .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
97 .It Sy Objective-C and Objective-C++ Language Options
98 .Fl fconstant-string-class= Ns Ar class-name
99 .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
101 .It Sy Language Independent Options
102 .Fl fmessage-length= Ns Ar n
103 .Fl fdiagnostics-show-location= Ns Oo Ns Ar once Ns | Ns Ar every-line Ns Oc
104 .Fl fdiagnostics-show-options
106 .It Sy Warning Options
107 .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
108 .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
110 .It Sy C-only Warning Options
111 .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
113 .It Sy Debugging Options
115 .Fl dumpspecs Fl dumpmachine Fl dumpversion Fl fdump-unnumbered Fl fdump-translation-unit- Ns Ar n
116 .Fl fdump-class-hierarchy- Ns Ar n
117 .Fl fdump-ipa-all Fl fdump-ipa-cgraph Fl fdump-tree-all Fl fdump-tree-original- Ns Ar n
118 .Fl fdump-tree-optimized- Ns Ar n
119 .Fl fdump-tree-inlined- Ns Ar n
120 .Fl fdump-tree-cfg Fl fdump-tree-vcg Fl fdump-tree-alias Fl fdump-tree-ch Fl fdump-tree-ssa- Ns Ar n
121 .Fl fdump-tree-pre- Ns Ar n
122 .Fl fdump-tree-ccp- Ns Ar n
123 .Fl fdump-tree-dce- Ns Ar n
124 .Fl fdump-tree-gimple Ns Oo Ns Ar -raw Ns Oc
125 .Fl fdump-tree-mudflap- Ns Ar n
126 .Fl fdump-tree-dom- Ns Ar n
127 .Fl fdump-tree-dse- Ns Ar n
128 .Fl fdump-tree-phiopt- Ns Ar n
129 .Fl fdump-tree-forwprop- Ns Ar n
130 .Fl fdump-tree-copyrename- Ns Ar n
131 .Fl fdump-tree-nrv Fl fdump-tree-vect Fl fdump-tree-sink Fl fdump-tree-sra- Ns Ar n
132 .Fl fdump-tree-salias Fl fdump-tree-fre- Ns Ar n
133 .Fl fdump-tree-vrp- Ns Ar n
134 .Fl ftree-vectorizer-verbose= Ns Ar n
135 .Fl fdump-tree-storeccp- Ns Ar n
136 .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
137 .Fl fsched-verbose= Ns Ar n
138 .Fl ftest-coverage Fl ftime-report Fl fvar-tracking Fl g Fl g Ns Ar level
139 .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
140 .Fl print-libgcc-file-name Fl print-multi-directory Fl print-multi-lib Fl print-prog-name= Ns Ar program
141 .Fl print-search-dirs Fl Q Fl save-temps Fl time
143 .It Sy Optimization Options
144 .Fl falign-functions Ns Oo = Ns Ar n Oc
145 .Fl falign-jumps Ns Oo = Ns Ar n Oc
146 .Fl falign-labels Ns Oo = Ns Ar n Oc
147 .Fl falign-loops Ns Oo = Ns Ar n Oc
148 .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
149 .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
150 .Fl fsched-stalled-insns-dep Ns Oo = Ns Ar n Oc
151 .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
152 .Fl O Fl O0 Fl O1 Fl O2 Fl O3 Fl \&Os
154 .It Sy Preprocessor Options
155 .Fl A Ns Ar question Ns = Ns Ar answer
156 .Fl A- Ns Ar question Ns = Ns Ar answer
157 .Fl C Fl dD Fl dI Fl dM Fl dN Fl D Ns Ar macro Ns = Ns Ar defn
158 .Fl E Fl H Fl idirafter Ar dir
162 .Fl iwithprefix Ar dir
163 .Fl iwithprefixbefore Ar dir
165 .Fl cxx-isystem Ar dir
167 .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
169 .Fl Xpreprocessor Ar option
171 .It Sy Assembler Option
173 .Fl Xassembler Ar option
175 .It Sy Linker Options
178 .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
179 .Fl Xlinker Ar option
182 .It Sy Directory Options
186 .Fl iremap Ns Ar src Ns : Ns Ar dst
188 .Fl specs= Ns Ar file
189 .Fl I- Fl -sysroot= Ns Ar dir
191 .It Sy Target Options
195 .It Sy Machine Dependent Options
197 .Fl EB Fl EL Fl mmangle-cpu Fl mcpu= Ns Ar cpu
198 .Fl mtext= Ns Ar text-section
199 .Fl mdata= Ns Ar data-section
200 .Fl mrodata= Ns Ar readonly-data-section
203 .Fl mapcs-frame Fl mno-apcs-frame Fl mabi= Ns Ar name
204 .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
205 .Fl msoft-float Fl mhard-float Fl mfpe Fl mthumb-interwork Fl mno-thumb-interwork Fl mcpu= Ns Ar name
206 .Fl march= Ns Ar name
208 .Fl mstructure-size-boundary= Ns Ar n
209 .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
210 .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
214 .Fl msize Fl minit-stack= Ns Ar n
215 .Fl mno-interrupts Fl mcall-prologues Fl mno-tablejump Fl mtiny-stack Fl mint8
218 .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
219 .Fl mlong-calls Fl mno-long-calls
225 .Fl mmax-stack-frame= Ns Ar n
226 .Fl melinux-stacksize= Ns Ar n
227 .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
230 .Fl mmac Fl mpush-args
233 .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
236 .Em DEC Alpha Options
237 .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
238 .Fl mfp-rounding-mode= Ns Ar mode
239 .Fl mtrap-precision= Ns Ar mode
240 .Fl mbuild-constants Fl mcpu= Ns Ar cpu-type
241 .Fl mtune= Ns Ar cpu-type
242 .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
244 .Em DEC Alpha/VMS Options
245 .Fl mvms-return-codes
248 .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
251 .Fl mrelax Fl mh Fl ms Fl mn Fl mint32 Fl malign-300
254 .Fl march= Ns Ar architecture-type
255 .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
256 .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
257 .Fl mspace-regs Fl msio Fl mwsio Fl munix= Ns Ar unix-std
258 .Fl nolibdld Fl static Fl threads
260 .Em i386 and x86-64 Options
261 .Fl mtune= Ns Ar cpu-type
262 .Fl march= Ns Ar cpu-type
263 .Fl mfpmath= Ns Ar unit
264 .Fl masm= Ns Ar dialect
265 .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
266 .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
267 .Fl msseregparm Fl momit-leaf-frame-pointer Fl mno-red-zone Fl mno-tls-direct-seg-refs Fl mcmodel= Ns Ar code-model
268 .Fl m32 Fl m64 Fl mlarge-data-threshold= Ns Ar num
271 .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
272 .Fl mtls-size= Ns Ar tls-size
273 .Fl mtune= Ns Ar cpu-type
274 .Fl mt Fl pthread Fl milp32 Fl mlp64
277 .Fl m32r2 Fl m32rx Fl m32r Fl mdebug Fl malign-loops Fl mno-align-loops Fl missue-rate= Ns Ar number
278 .Fl mbranch-cost= Ns Ar number
279 .Fl mmodel= Ns Ar code-size-model-type
280 .Fl msdata= Ns Ar sdata-type
281 .Fl mno-flush-func Fl mflush-func= Ns Ar name
282 .Fl mno-flush-trap Fl mflush-trap= Ns Ar number
287 .Fl msim Fl memregs= Ns Ar number
290 .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
293 .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
296 .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
299 .Fl EL Fl EB Fl march= Ns Ar arch
300 .Fl mtune= Ns Ar arch
301 .Fl mips1 Fl mips2 Fl mips3 Fl mips4 Fl mips32 Fl mips32r2 Fl mips64 Fl mips16 Fl mno-mips16 Fl mabi= Ns Ar abi
302 .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
303 .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
304 .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
307 .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
310 .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
313 .Fl mno-crt0 Fl mbacc Fl msim Fl march= Ns Ar cpu-type
317 .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
320 See RS/6000 and PowerPC Options.
322 .Em RS/6000 and PowerPC Options
323 .Fl mcpu= Ns Ar cpu-type
324 .Fl mtune= Ns Ar cpu-type
325 .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
326 .Fl msched-costly-dep= Ns Ar dependence_type
327 .Fl minsert-sched-nops= Ns Ar scheme
328 .Fl mcall-sysv Fl mcall-netbsd Fl maix-struct-return Fl msvr4-struct-return Fl mabi= Ns Ar abi-type
329 .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
330 .Fl mvxworks Fl mwindiss Fl G Ar num
333 .Em S/390 and zSeries Options
334 .Fl mtune= Ns Ar cpu-type
335 .Fl march= Ns Ar cpu-type
336 .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
339 .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
340 .Fl mdiv= Ns Ar strategy
341 .Fl mdivsi3_libfunc= Ns Ar name
342 .Fl madjust-unroll Fl mindexed-addressing Fl mgettrcost= Ns Ar number
343 .Fl mpt-fixed Fl minvalid-symbols
346 .Fl mcpu= Ns Ar cpu-type
347 .Fl mtune= Ns Ar cpu-type
348 .Fl mcmodel= Ns Ar code-model
349 .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
352 .Fl Qy Fl Qn Fl YP, Ns Ar paths
355 .Em TMS320C3x/C4x Options
357 .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
358 .Fl mrptb Fl mdb Fl mloop-unsigned Fl mparallel-insns Fl mparallel-mpy Fl mpreserve-float
361 .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
364 .Fl mapp-regs Fl mno-app-regs Fl mdisable-callt Fl mno-disable-callt Fl mv850e1 Fl mv850e Fl mv850 Fl mbig-switch
367 .Fl mg Fl mgnu Fl munix
370 See i386 and x86-64 Options.
372 .Em Xstormy16 Options
376 .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
379 See S/390 and zSeries Options.
381 .It Sy Code Generation Options
382 .Fl fcall-saved- Ns Ar reg
383 .Fl fcall-used- Ns Ar reg
384 .Fl ffixed- Ns Ar reg
385 .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
386 .Fl fstack-check Fl fstack-limit-register= Ns Ar reg
387 .Fl fstack-limit-symbol= Ns Ar sym
388 .Fl fno-stack-limit Fl fargument-alias Fl fargument-noalias Fl fargument-noalias-global Fl fleading-underscore Fl ftls-model= Ns Ar model
389 .Fl ftrapv Fl fwrapv Fl fbounds-check Fl fvisibility
392 .Ss Options Controlling the Kind of Output
393 Compilation can involve up to four stages: preprocessing, compilation proper, assembly and linking, always in that order.
394 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.
396 For any given input file, the file name suffix determines what kind of compilation is done:
399 .It Em file Ns Sy .c Ns
400 C source code which must be preprocessed.
402 .It Em file Ns Sy .i Ns
403 C source code which should not be preprocessed.
405 .It Em file Ns Sy .ii Ns
406 C++ source code which should not be preprocessed.
408 .It Em file Ns Sy .m Ns
409 Objective-C source code.
410 Note that you must link with the
412 library to make an Objective-C program work.
414 .It Em file Ns Sy .mi Ns
415 Objective-C source code which should not be preprocessed.
417 .It Em file Ns Sy .mm Ns
418 .It Em file Ns Sy .M Ns
419 Objective-C++ source code.
420 Note that you must link with the
422 library to make an Objective-C++ program work.
425 refers to a literal capital M.
427 .It Em file Ns Sy .mii Ns
428 Objective-C++ source code which should not be preprocessed.
430 .It Em file Ns Sy .h Ns
431 C, C++, Objective-C or Objective-C++ header file to be turned into a precompiled header.
433 .It Em file Ns Sy .cc Ns
434 .It Em file Ns Sy .cp Ns
435 .It Em file Ns Sy .cxx Ns
436 .It Em file Ns Sy .cpp Ns
437 .It Em file Ns Sy .CPP Ns
438 .It Em file Ns Sy .c++ Ns
439 .It Em file Ns Sy .C Ns
440 C++ source code which must be preprocessed.
443 the last two letters must both be literally
447 refers to a literal capital C.
449 .It Em file Ns Sy .mm Ns
450 .It Em file Ns Sy .M Ns
451 Objective-C++ source code which must be preprocessed.
453 .It Em file Ns Sy .mii Ns
454 Objective-C++ source code which should not be preprocessed.
456 .It Em file Ns Sy .hh Ns
457 .It Em file Ns Sy .H Ns
458 C++ header file to be turned into a precompiled header.
460 .It Em file Ns Sy .f Ns
461 .It Em file Ns Sy .for Ns
462 .It Em file Ns Sy .FOR Ns
463 Fixed form Fortran source code which should not be preprocessed.
465 .It Em file Ns Sy .F Ns
466 .It Em file Ns Sy .fpp Ns
467 .It Em file Ns Sy .FPP Ns
468 Fixed form Fortran source code which must be preprocessed (with the traditional preprocessor).
470 .It Em file Ns Sy .f90 Ns
471 .It Em file Ns Sy .f95 Ns
472 Free form Fortran source code which should not be preprocessed.
474 .It Em file Ns Sy .F90 Ns
475 .It Em file Ns Sy .F95 Ns
476 Free form Fortran source code which must be preprocessed (with the traditional preprocessor).
478 .It Em file Ns Sy .ads Ns
479 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).
480 Such files are also called
483 .It Em file Ns Sy .adb Ns
484 Ada source code file containing a library unit body (a subprogram or package body).
485 Such files are also called
488 .It Em file Ns Sy .s Ns
491 .It Em file Ns Sy .S Ns
492 Assembler code which must be preprocessed.
495 An object file to be fed straight into linking.
496 Any file name with no recognized suffix is treated this way.
499 You can specify the input language explicitly with the
505 Specify explicitly the
507 for the following input files (rather than letting the compiler choose a default based on the file name suffix).
508 This option applies to all following input files until the next
515 .Bd -literal -offset indent
516 c c-header c-cpp-output
517 c++ c++-header c++-cpp-output
518 objective-c objective-c-header objective-c-cpp-output
519 objective-c++ objective-c++-header objective-c++-cpp-output
520 assembler assembler-with-cpp
527 Turn off any specification of a language, so that subsequent files are handled according to their file name suffixes (as they are if
529 has not been used at all).
531 .It Fl pass-exit-codes
534 program will exit with the code of 1 if any phase of the compiler returns a non-success return code.
536 .Fl pass-exit-codes ,
539 program will instead return with numerically highest error produced by any phase that returned an error indication.
542 If you only want some of the stages of compilation, you can use
544 (or filename suffixes) to tell
546 where to start, and one of the options
554 Note that some combinations (for example,
555 .Fl x Ar cpp-output Fl E )
558 to do nothing at all.
562 Compile or assemble the source files, but do not link.
563 The linking stage simply is not done.
564 The ultimate output is in the form of an object file for each source file.
566 By default, the object file name for a source file is made by replacing the suffix
573 Unrecognized input files, not requiring compilation or assembly, are ignored.
576 Stop after the stage of compilation proper; do not assemble.
577 The output is in the form of an assembler code file for each non-assembler input file specified.
579 By default, the assembler file name for a source file is made by replacing the suffix
585 Input files that don't require compilation are ignored.
588 Stop after the preprocessing stage; do not run the compiler proper.
589 The output is in the form of preprocessed source code, which is sent to the standard output.
591 Input files which don't require preprocessing are ignored.
596 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.
600 is not specified, the default is to put an executable file in
606 its assembler file in
608 a precompiled header file in
609 .Pa source.suffix.gch ,
610 and all preprocessed C source on standard output.
613 Print (on standard error output) the commands executed to run the stages of compilation.
614 Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.
619 except the commands are not executed and all command arguments are quoted.
620 This is useful for shell scripts to capture the driver-generated command lines.
623 Use pipes rather than temporary files for communication between the various stages of compilation.
624 This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble.
627 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).
628 This will allow intermodule analysis (IMA) to be performed by the compiler.
629 Currently the only language for which this is supported is C.
630 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.
631 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.
632 If you use this option in conjunction with
634 the compiler will generate multiple pre-processed files (one for each source file), but only one (combined)
641 Print (on the standard output) a description of the command line options understood by
645 option is also specified then
647 will also be passed on to the various processes invoked by
649 so that they can display the command line options they accept.
652 option is also specified then command line options which have no documentation associated with them will also be displayed.
655 Print (on the standard output) a description of target specific command line options for each tool.
658 Display the version number and copyrights of the invoked GCC.
661 .Ss Compiling C++ Programs
662 C++ source files conventionally use one of the suffixes
671 C++ header files often use
675 and preprocessed C++ files use the suffix
677 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
680 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.
681 You might also like to precompile a C header file with a
683 extension to be used in C++ compilations.
685 is a program that calls GCC with the default language set to C++, and automatically specifies linking against the C++ library.
688 is also installed with the name
691 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.
692 .Ss Options Controlling C Dialect
693 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:
697 In C mode, support all ISO C90 programs.
698 In C++ mode, remove GNU extensions that conflict with ISO C++.
700 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
704 keywords, and predefined macros such as
708 that identify the type of system you are using.
709 It also enables the undesirable and rarely used ISO trigraph feature.
710 For the C compiler, it disables recognition of C++ style
712 comments as well as the
716 The alternate keywords
722 continue to work despite
724 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
726 Alternate predefined macros such as
730 are also available, with or without
735 option does not cause non-ISO programs to be rejected gratuitously.
738 is required in addition to
743 is predefined when the
746 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.
748 Functions which would normally be built in but do not have semantics defined by ISO C (such as
752 are not built-in functions with
757 Determine the language standard.
758 This option is currently only supported when compiling C or C++.
759 A value for this option must be provided; possible values are
763 .It Sy iso9899:1990 Ns
767 .It Sy iso9899:199409 Ns
768 ISO C90 as modified in amendment 1.
772 .It Sy iso9899:1999 Ns
773 .It Sy iso9899:199x Ns
775 Note that this standard is not yet fully supported; see
776 .Lk http://gcc.gnu.org/gcc-4.1/c99status.html
777 for more information.
785 Default, ISO C90 plus GNU extensions (including some C99 features).
789 ISO C99 plus GNU extensions.
790 When ISO C99 is fully implemented in GCC, this will become the default.
796 The 1998 ISO C++ standard plus amendments.
802 This is the default for C++ code.
805 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.
806 For example, you may use
814 options specifying some version of ISO C have the same effects as
816 except that features that were not in ISO C90 but are in the specified version (for example,
820 keyword in ISO C99) are not disabled.
825 tells GCC to use the traditional GNU semantics for
827 functions when in C99 mode.
828 Using this option is roughly equivalent to adding the
830 function attribute to all inline functions.
832 This option is accepted by GCC versions 4.1.3 and up.
833 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.
836 is not supported in versions of GCC before 4.3.
837 It will be supported only in C99 or gnu99 mode, not in C89 or gnu89 mode.
839 The preprocesor macros
840 .Va __GNUC_GNU_INLINE__
842 .Va __GNUC_STDC_INLINE__
843 may be used to check which semantics are in effect for
847 .It Fl aux-info Ar filename
848 Output to the given filename prototyped declarations for all functions declared and/or defined in a translation unit, including those in header files.
849 This option is silently ignored in any language other than C.
851 Besides declarations, the file indicates, in comments, the origin of each declaration (source file and line), whether the declaration was implicit, prototyped or unprototyped
856 for old, respectively, in the first character after the line number and the colon), and whether it came from a declaration or a definition
860 respectively, in the following character).
861 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.
869 as a keyword, so that code can use these words as identifiers.
870 You can use the keywords
880 In C++, this switch only affects the
886 are standard keywords.
887 You may want to use the
889 flag instead, which has the same effect.
894 this switch only affects the
900 is a standard keyword in ISO C99.
903 .It Fl fno-builtin- Ns Ar function
904 Don't recognize built-in functions that do not begin with
908 GCC normally generates special code to handle certain built-in functions more efficiently; for instance, calls to
910 may become single instructions that adjust the stack directly, and calls to
912 may become inline copy loops.
913 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.
914 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.
915 For example, warnings are given with
923 is known not to modify global memory.
926 .Fl fno-builtin- Ns Ar function
927 option only the built-in function
933 If a function is named this is not built-in in this version of GCC, this option is ignored.
934 There is no corresponding
935 .Fl fbuiltin- Ns Ar function
936 option; if you wish to enable built-in functions selectively when using
940 you may define macros such as:
942 .Bd -literal -offset indent
943 #define abs(n) __builtin_abs ((n))
944 #define strcpy(d, s) __builtin_strcpy ((d), (s))
947 Assert that compilation takes place in a hosted environment.
950 A hosted environment is one in which the entire standard library is available, and in which
954 Examples are nearly everything except a kernel.
955 This is equivalent to
956 .Fl fno-freestanding .
959 Assert that compilation takes place in a freestanding environment.
962 A freestanding environment is one in which the standard library may not exist, and program startup may not necessarily be at
964 The most obvious example is an OS kernel.
965 This is equivalent to
968 .It Fl fms-extensions
969 Accept some non-standard constructs used in Microsoft header files.
971 Some cases of unnamed fields in structures and unions are only accepted with this option.
974 Support ISO C trigraphs.
979 options for strict ISO C conformance) implies
982 .It Fl no-integrated-cpp
983 Performs a compilation in two passes: preprocessing and compiling.
984 This option allows a user supplied "cc1", "cc1plus", or "cc1obj" via the
987 The user supplied compilation step can then add in an additional preprocessing step after normal preprocessing but before compiling.
988 The default is to use the integrated cpp (internal cpp)
990 The semantics of this option will change if "cc1", "cc1plus", and "cc1obj" are merged.
993 .It Fl traditional-cpp
994 Formerly, these options caused GCC to attempt to emulate a pre-standard C compiler.
995 They are now only supported with the
998 The preprocessor continues to support a pre-standard mode.
999 See the GNU CPP manual for details.
1001 .It Fl fcond-mismatch
1002 Allow conditional expressions with mismatched types in the second and third arguments.
1003 The value of such an expression is void.
1004 This option is not supported for C++.
1006 .It Fl funsigned-char
1012 Each kind of machine has a default for what
1021 Ideally, a portable program should always use
1025 when it depends on the signedness of an object.
1026 But many programs have been written to use plain
1028 and expect it to be signed, or expect it to be unsigned, depending on the machines they were written for.
1029 This option, and its inverse, let you make such a program work with the opposite default.
1033 is always a distinct type from each of
1037 even though its behavior is always just like one of those two.
1045 Note that this is equivalent to
1046 .Fl fno-unsigned-char ,
1047 which is the negative form of
1048 .Fl funsigned-char .
1049 Likewise, the option
1052 .Fl funsigned-char .
1054 .It Fl fsigned-bitfields
1055 .It Fl funsigned-bitfields
1056 .It Fl fno-signed-bitfields
1057 .It Fl fno-unsigned-bitfields
1058 These options control whether a bit-field is signed or unsigned, when the declaration does not use either
1062 By default, such a bit-field is signed, because this is consistent: the basic integer types such as
1067 .Ss Options Controlling C++ Dialect
1068 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.
1069 For example, you might compile a file
1073 .Bd -literal -offset indent
1074 g++ -g -frepo -O -c firstClass.C
1076 In this example, only
1078 is an option meant only for C++ programs; you can use the other options with any language supported by GCC.
1080 Here is a list of options that are
1082 for compiling C++ programs:
1085 .It Fl fabi-version= Ns Ar n
1089 Version 2 is the version of the C++ ABI that first appeared in G++ 3.4.
1090 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
1091 Version 0 will always be the version that conforms most closely to the C++ ABI specification.
1092 Therefore, the ABI obtained using version 0 will change as ABI bugs are fixed.
1094 The default is version 2.
1096 .It Fl fno-access-control
1097 Turn off all access checking.
1098 This switch is mainly useful for working around bugs in the access control code.
1101 Check that the pointer returned by
1103 is non-null before attempting to modify the storage allocated.
1104 This check is normally unnecessary because the C++ standard specifies that
1110 in which case the compiler will always check the return value even without this option.
1111 In all other cases, when
1113 has a non-empty exception specification, memory exhaustion is signalled by throwing
1114 .Va std::bad_alloc .
1118 .It Fl fconserve-space
1119 Put uninitialized or runtime-initialized global variables into the common segment, as C does.
1120 This saves space in the executable at the cost of not diagnosing duplicate definitions.
1121 If you compile with this flag and your program mysteriously crashes after
1123 has completed, you may have an object that is being destroyed twice because two definitions were merged.
1125 This option is no longer useful on most targets, now that support has been added for putting variables into BSS without making them common.
1127 .It Fl ffriend-injection
1128 Inject friend functions into the enclosing namespace, so that they are visible outside the scope of the class in which they are declared.
1129 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.
1130 However, in ISO C++ a friend function which is not declared in an enclosing scope can only be found using argument dependent lookup.
1131 This option causes friends to be injected as they were in earlier releases.
1133 This option is for compatibility, and may be removed in a future release of G++.
1135 .It Fl fno-const-strings
1136 Give string constants type
1140 By default, G++ uses type
1142 as required by the standard.
1144 .Fl fno-const-strings ,
1145 you cannot actually modify the value of a string constant.
1147 This option might be removed in a future release of G++.
1148 For maximum portability, you should structure your code so that it works with string constants that have type
1151 .It Fl fno-elide-constructors
1152 The C++ standard allows an implementation to omit creating a temporary which is only used to initialize another object of the same type.
1153 Specifying this option disables that optimization, and forces G++ to call the copy constructor in all cases.
1155 .It Fl fno-enforce-eh-specs
1156 Don't generate code to check for violation of exception specifications at runtime.
1157 This option violates the C++ standard, but may be useful for reducing code size in production builds, much like defining
1159 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.
1162 .It Fl fno-for-scope
1165 is specified, the scope of variables declared in a
1166 .Em for-init-statement
1169 loop itself, as specified by the C++ standard.
1172 is specified, the scope of variables declared in a
1173 .Em for-init-statement
1174 extends to the end of the enclosing scope, as was the case in old versions of G++, and other (traditional) implementations of C++.
1176 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.
1178 .It Fl fno-gnu-keywords
1181 as a keyword, so that code can use this word as an identifier.
1182 You can use the keyword
1187 .Fl fno-gnu-keywords .
1189 .It Fl fno-implicit-templates
1190 Never emit code for non-inline templates which are instantiated implicitly (i.e. by use); only emit code for explicit instantiations.
1192 .It Fl fno-implicit-inline-templates
1193 Don't emit code for implicit instantiations of inline templates, either.
1194 The default is to handle inlines differently so that compiles with and without optimization will need the same set of explicit instantiations.
1196 .It Fl fno-implement-inlines
1197 To save space, do not emit out-of-line copies of inline functions controlled by
1198 .Sy #pragma implementation .
1199 This will cause linker errors if these functions are not inlined everywhere they are called.
1201 .It Fl fms-extensions
1202 Disable pedantic warnings about constructs used in MFC, such as implicit int and getting a pointer to member function via non-standard syntax.
1204 .It Fl fno-nonansi-builtins
1205 Disable built-in declarations of functions that are not mandated by ANSI/ISO C.
1213 and other related functions.
1215 .It Fl fno-operator-names
1216 Do not treat the operator name keywords
1225 as synonyms as keywords.
1227 .It Fl fno-optional-diags
1228 Disable diagnostics that the standard says a compiler does not need to issue.
1229 Currently, the only such diagnostic issued by G++ is the one for a name having multiple meanings within a class.
1232 Downgrade some diagnostics about nonconformant code from errors to warnings.
1235 will allow some nonconforming code to compile.
1238 Enable automatic template instantiation at link time.
1239 This option also implies
1240 .Fl fno-implicit-templates .
1243 Disable generation of information about every class with virtual functions for use by the C++ runtime type identification features
1247 If you don't use those parts of the language, you can save some space by using this flag.
1248 Note that exception handling uses the same information, but it will generate it as needed.
1251 Emit statistics about front-end processing at the end of the compilation.
1252 This information is generally only useful to the G++ development team.
1254 .It Fl ftemplate-depth- Ns Ar n
1255 Set the maximum instantiation depth for template classes to
1257 A limit on the template instantiation depth is needed to detect endless recursions during template class instantiation.
1258 ANSI/ISO C++ conforming programs must not rely on a maximum depth greater than 17.
1260 .It Fl fno-threadsafe-statics
1261 Do not emit the extra code to use the routines specified in the C++ ABI for thread-safe initialization of local statics.
1262 You can use this option to reduce code size slightly in code that doesn't need to be thread-safe.
1264 .It Fl fuse-cxa-atexit
1265 Register destructors for objects with static storage duration with the
1267 function rather than the
1270 This option is required for fully standards-compliant handling of static destructors, but will only work if your C library supports
1273 .It Fl fvisibility-inlines-hidden
1274 Causes all inlined methods to be marked with
1275 .Va __attribute__ ((visibility ("hidden")))
1276 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.
1277 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.
1278 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.
1279 For even more savings, combine with the
1280 .Fl fvisibility=hidden
1284 Do not use weak symbol support, even if it is provided by the linker.
1285 By default, G++ will use weak symbols if they are available.
1286 This option exists only for testing, and should not be used by end-users; it will result in inferior code and has no benefits.
1287 This option may be removed in a future release of G++.
1290 Do not search for header files in the standard directories specific to C++, but do still search the other standard directories.
1291 (This option is used when building the C++ library.)
1294 In addition, these optimization, warning, and code generation options have meanings only for C++ programs:
1297 .It Fl fno-default-inline
1300 for functions defined inside a class scope.
1301 Note that these functions will have linkage like inline functions; they just won't be inlined by default.
1303 .It Fl Wabi (C++ only)
1304 Warn when G++ generates code that is probably not compatible with the vendor-neutral C++ ABI.
1305 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.
1306 There may also be cases where warnings are emitted even though the code that is generated will be compatible.
1308 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.
1310 The known incompatibilities at this point include:
1314 Incorrect handling of tail-padding for bit-fields.
1315 G++ may attempt to pack data into the same byte as a base class.
1318 .Bd -literal -offset indent
1319 struct A { virtual void f(); int f1 : 1; };
1320 struct B : public A { int f2 : 1; };
1322 In this case, G++ will place
1324 into the same byte as
1326 other compilers will not.
1327 You can avoid this problem by explicitly padding
1329 so that its size is a multiple of the byte size on your platform; that will cause G++ and other compilers to layout
1334 Incorrect handling of tail-padding for virtual bases.
1335 G++ does not use tail padding when laying out virtual bases.
1338 .Bd -literal -offset indent
1339 struct A { virtual void f(); char c1; };
1340 struct B { B(); char c2; };
1341 struct C : public A, public virtual B {};
1343 In this case, G++ will not place
1345 into the tail-padding for
1347 other compilers will.
1348 You can avoid this problem by explicitly padding
1350 so that its size is a multiple of its alignment (ignoring virtual base classes); that will cause G++ and other compilers to layout
1355 Incorrect handling of bit-fields with declared widths greater than that of their underlying types, when the bit-fields appear in a union.
1358 .Bd -literal -offset indent
1359 union U { int i : 4096; };
1363 does not have 4096 bits, G++ will make the union too small by the number of bits in an
1367 Empty classes can be placed at incorrect offsets.
1370 .Bd -literal -offset indent
1378 struct C : public B, public A {};
1384 at a nonzero offset; it should be placed at offset zero.
1385 G++ mistakenly believes that the
1389 is already at offset zero.
1392 Names of template functions whose types involve
1394 or template template parameters can be mangled incorrectly.
1396 .Bd -literal -offset indent
1397 template \*[Lt]typename Q\*[Gt]
1398 void f(typename Q::X) {}
1400 template \*[Lt]template \*[Lt]typename\*[Gt] class Q\*[Gt]
1401 void f(typename Q\*[Lt]int\*[Gt]::X) {}
1403 Instantiations of these templates may be mangled incorrectly.
1406 .It Fl Wctor-dtor-privacy (C++ only)
1407 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.
1409 .It Fl Wnon-virtual-dtor (C++ only)
1410 Warn when a class appears to be polymorphic, thereby requiring a virtual destructor, yet it declares a non-virtual one.
1411 This warning is enabled by
1414 .It Fl Wreorder (C++ only)
1415 Warn when the order of member initializers given in the code does not match the order in which they must be executed.
1418 .Bd -literal -offset indent
1422 A(): j (0), i (1) { }
1425 The compiler will rearrange the member initializers for
1429 to match the declaration order of the members, emitting a warning to that effect.
1430 This warning is enabled by
1436 options are not affected by
1440 .It Fl Weffc++ (C++ only)
1441 Warn about violations of the following style guidelines from Scott Meyers'
1447 Item 11: Define a copy constructor and an assignment operator for classes with dynamically allocated memory.
1450 Item 12: Prefer initialization to assignment in constructors.
1453 Item 14: Make destructors virtual in base classes.
1458 return a reference to
1462 Item 23: Don't try to return a reference when you must return an object.
1465 Also warn about violations of the following style guidelines from Scott Meyers'
1466 .Em More Effective C++
1471 Item 6: Distinguish between prefix and postfix forms of increment and decrement operators.
1474 Item 7: Never overload
1481 When selecting this option, be aware that the standard library headers do not obey all of these guidelines; use
1483 to filter out those warnings.
1485 .It Fl Wno-deprecated (C++ only)
1486 Do not warn about usage of deprecated features.
1488 .It Fl Wstrict-null-sentinel (C++ only)
1489 Warn also about the use of an uncasted
1492 When compiling only with GCC this is a valid sentinel, as
1496 Although it is a null pointer constant not a null pointer, it is guaranteed to of the same size as a pointer.
1497 But this use is not portable across different compilers.
1499 .It Fl Wno-non-template-friend (C++ only)
1500 Disable warnings when non-templatized friend functions are declared within a template.
1501 Since the advent of explicit template specification support in G++, if the name of the friend is an unqualified-id (i.e.,
1502 .Sy friend foo(int) ) ,
1503 the C++ language specification demands that the friend declare or define an ordinary, nontemplate function.
1505 Before G++ implemented explicit specification, unqualified-ids could be interpreted as a particular specialization of a templatized function.
1506 Because this non-conforming behavior is no longer the default behavior for G++,
1507 .Fl Wnon-template-friend
1508 allows the compiler to check existing code for potential trouble spots and is on by default.
1509 This new compiler behavior can be turned off with
1510 .Fl Wno-non-template-friend
1511 which keeps the conformant compiler code but disables the helpful warning.
1513 .It Fl Wold-style-cast (C++ only)
1514 Warn if an old-style (C-style) cast to a non-void type is used within a C++ program.
1516 .Sy ( dynamic_cast ,
1518 .Sy reinterpret_cast ,
1521 are less vulnerable to unintended effects and much easier to search for.
1523 .It Fl Woverloaded-virtual (C++ only)
1524 Warn when a function declaration hides virtual functions from a base class.
1527 .Bd -literal -offset indent
1532 struct B: public A {
1544 .Bd -literal -offset indent
1548 will fail to compile.
1550 .It Fl Wno-pmf-conversions (C++ only)
1551 Disable the diagnostic for converting a bound pointer to member function to a plain pointer.
1553 .It Fl Wsign-promo (C++ only)
1554 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.
1555 Previous versions of G++ would try to preserve unsignedness, but the standard mandates the current behavior.
1557 .Bd -literal -offset indent
1560 A& operator = (int);
1569 In this example, G++ will synthesize a default
1570 .Sy A& operator = (const A&); ,
1571 while cfront will use the user-defined
1575 .Ss Options Controlling Objective-C and Objective-C++ Dialects
1576 (NOTE: This manual does not describe the Objective-C and Objective-C++ languages themselves.
1579 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.
1580 For example, you might compile a file
1584 .Bd -literal -offset indent
1585 gcc -g -fgnu-runtime -O -c some_class.m
1589 is an option meant only for Objective-C and Objective-C++ programs; you can use the other options with any language supported by GCC.
1591 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.,
1592 .Fl Wtraditional ) .
1593 Similarly, Objective-C++ compilations may use C++-specific options (e.g.,
1596 Here is a list of options that are
1598 for compiling Objective-C and Objective-C++ programs:
1601 .It Fl fconstant-string-class= Ns Ar class-name
1604 as the name of the class to instantiate for each literal string specified with the syntax
1606 The default class name is
1607 .Va NXConstantString
1608 if the GNU runtime is being used, and
1609 .Va NSConstantString
1610 if the NeXT runtime is being used (see below).
1612 .Fl fconstant-cfstrings
1613 option, if also present, will override the
1614 .Fl fconstant-string-class
1617 literals to be laid out as constant CoreFoundation strings.
1620 Generate object code compatible with the standard GNU Objective-C runtime.
1621 This is the default for most types of systems.
1623 .It Fl fnext-runtime
1624 Generate output compatible with the NeXT runtime.
1625 This is the default for NeXT-based systems, including Darwin and Mac OS X.
1627 .Va __NEXT_RUNTIME__
1628 is predefined if (and only if) this option is used.
1630 .It Fl fno-nil-receivers
1631 Assume that all Objective-C message dispatches (e.g.,
1632 .Va [receiver message:arg] )
1633 in this translation unit ensure that the receiver is not
1635 This allows for more efficient entry points in the runtime to be used.
1636 Currently, this option is only available in conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1638 .It Fl fobjc-call-cxx-cdtors
1639 For each Objective-C class, check if any of its instance variables is a C++ object with a non-trivial default constructor.
1640 If so, synthesize a special
1641 .Va - (id) .cxx_construct
1642 instance method that will run non-trivial default constructors on any such instance variables, in order, and then return
1644 Similarly, check if any instance variable is a C++ object with a non-trivial destructor, and if so, synthesize a special
1645 .Va - (void) .cxx_destruct
1646 method that will run all such default destructors, in reverse order.
1649 .Va - (id) .cxx_construct
1651 .Va - (void) .cxx_destruct
1652 methods thusly generated will only operate on instance variables declared in the current Objective-C class, and not those inherited from superclasses.
1653 It is the responsibility of the Objective-C runtime to invoke all such methods in an object's inheritance hierarchy.
1655 .Va - (id) .cxx_construct
1656 methods will be invoked by the runtime immediately after a new object instance is allocated; the
1657 .Va - (void) .cxx_destruct
1658 methods will be invoked immediately before the runtime deallocates an object instance.
1660 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has support for invoking the
1661 .Va - (id) .cxx_construct
1663 .Va - (void) .cxx_destruct
1666 .It Fl fobjc-direct-dispatch
1667 Allow fast jumps to the message dispatcher.
1668 On Darwin this is accomplished via the comm page.
1670 .It Fl fobjc-exceptions
1671 Enable syntactic support for structured exception handling in Objective-C, similar to what is offered by C++ and Java.
1672 Currently, this option is only available in conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1674 .Bd -literal -offset indent
1680 @catch (AnObjCClass *exc) {
1687 @catch (AnotherClass *exc) {
1690 @catch (id allOthers) {
1701 statement may appear anywhere in an Objective-C or Objective-C++ program; when used inside of a
1705 may appear without an argument (as shown above), in which case the object caught by the
1709 Note that only (pointers to) Objective-C objects may be thrown and caught using this scheme.
1710 When an object is thrown, it will be caught by the nearest
1712 clause capable of handling objects of that type, analogously to how
1714 blocks work in C++ and Java.
1717 clause (as shown above) may also be provided to catch any and all Objective-C exceptions not caught by previous
1723 clause, if present, will be executed upon exit from the immediately preceding
1726 This will happen regardless of whether any exceptions are thrown, caught or rethrown inside the
1728 section, analogously to the behavior of the
1732 There are several caveats to using the new exception mechanism:
1736 Although currently designed to be binary compatible with
1738 -style idioms provided by the
1740 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.
1743 As mentioned above, the new exceptions do not support handling types other than Objective-C objects.
1744 Furthermore, when used from Objective-C++, the Objective-C exception model does not interoperate with C++ exceptions at this time.
1745 This means you cannot
1747 an exception from Objective-C and
1749 it in C++, or vice versa (i.e.,
1750 .Va throw ... @catch ) .
1754 .Fl fobjc-exceptions
1755 switch also enables the use of synchronization blocks for thread-safe execution:
1757 .Bd -literal -offset indent
1758 @synchronized (ObjCClass *guard) {
1764 block, a thread of execution shall first check whether a lock has been placed on the corresponding
1766 object by another thread.
1767 If it has, the current thread shall wait until the other thread relinquishes its lock.
1770 becomes available, the current thread will place its own lock on it, execute the code contained in the
1772 block, and finally relinquish the lock (thereby making
1774 available to other threads).
1776 Unlike Java, Objective-C does not allow for entire methods to be marked
1778 Note that throwing exceptions out of
1780 blocks is allowed, and will cause the guarding object to be unlocked properly.
1783 Enable garbage collection (GC) in Objective-C and Objective-C++ programs.
1785 .It Fl freplace-objc-classes
1786 Emit a special marker instructing
1788 not to statically link in the resulting object file, and allow
1790 to load it in at run time instead.
1791 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.
1792 Currently, Fix-and-Continue functionality is only available in conjunction with the NeXT runtime on Mac OS X 10.3 and later.
1795 When compiling for the NeXT runtime, the compiler ordinarily replaces calls to
1796 .Va objc_getClass("...")
1797 (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.
1800 flag suppresses this behavior and causes calls to
1801 .Va objc_getClass("...")
1803 This is useful in Zero-Link debugging mode, since it allows for individual class implementations to be modified during program execution.
1806 Dump interface declarations for all classes seen in the source file to a file named
1807 .Pa sourcename.decl .
1809 .It Fl Wassign-intercept
1810 Warn whenever an Objective-C assignment is being intercepted by the garbage collector.
1813 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.
1814 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.
1817 option, then methods inherited from the superclass are considered to be implemented, and no warning is issued for them.
1820 Warn if multiple methods of different types for the same selector are found during compilation.
1821 The check is performed on the list of methods in the final stage of compilation.
1822 Additionally, a check is performed for each selector appearing in a
1824 expression, and a corresponding method for that selector has been found during compilation.
1825 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
1827 option is being used.
1829 .It Fl Wstrict-selector-match
1830 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
1834 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.
1836 .It Fl Wundeclared-selector
1839 expression referring to an undeclared selector is found.
1840 A selector is considered undeclared if no method with that name has been declared before the
1842 expression, either explicitly in an
1846 declaration, or implicitly in an
1849 This option always performs its checks as soon as a
1851 expression is found, while
1853 only performs its checks in the final stage of compilation.
1854 This also enforces the coding style convention that methods and selectors must be declared before being used.
1856 .It Fl print-objc-runtime-info
1857 Generate C header describing the largest structure that is passed by value, if any.
1860 .Ss Options to Control Diagnostic Messages Formatting
1861 Traditionally, diagnostic messages have been formatted irrespective of the output device's aspect (e.g. its width, ...).
1862 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.
1863 Right now, only the C++ front end can honor these options.
1864 However it is expected, in the near future, that the remaining front ends would be able to digest them correctly.
1867 .It Fl fmessage-length= Ns Ar n
1868 Try to format error messages so that they fit on lines of about
1871 The default is 72 characters for
1873 and 0 for the rest of the front ends supported by GCC.
1876 is zero, then no line-wrapping will be done; each error message will appear on a single line.
1878 .It Fl fdiagnostics-show-location=once
1879 Only meaningful in line-wrapping mode.
1880 Instructs the diagnostic messages reporter to emit
1882 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.
1883 This is the default behavior.
1885 .It Fl fdiagnostics-show-location=every-line
1886 Only meaningful in line-wrapping mode.
1887 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.
1889 .It Fl fdiagnostics-show-options
1890 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.
1893 .Ss Options to Request or Suppress Warnings
1894 Warnings are diagnostic messages that report constructions which are not inherently erroneous but which are risky or suggest there may have been an error.
1896 You can request many specific warnings with options beginning
1900 to request warnings on implicit declarations.
1901 Each of these specific warning options also has a negative form beginning
1903 to turn off warnings; for example,
1905 This manual lists only one of the two forms, whichever is not the default.
1907 The following options control the amount and kinds of warnings produced by GCC; for further, language-specific options also refer to
1908 .Sy C++ Dialect Options
1910 .Sy Objective-C and Objective-C++ Dialect Options .
1914 Check the code for syntax errors, but don't do anything beyond that.
1917 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++.
1918 For ISO C, follows the version of the ISO C standard specified by any
1922 Valid ISO C and ISO C++ programs should compile properly with or without this option (though a rare few will require
1926 option specifying the required version of ISO C).
1927 However, without this option, certain GNU extensions and traditional C and C++ features are supported as well.
1928 With this option, they are rejected.
1931 does not cause warning messages for use of the alternate keywords whose names begin and end with
1933 Pedantic warnings are also disabled in the expression that follows
1935 However, only system header files should use these escape routes; application programs should avoid them.
1937 Some users try to use
1939 to check programs for strict ISO C conformance.
1940 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
1942 a diagnostic, and some others for which diagnostics have been added.
1944 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
1946 We don't have plans to support such a feature in the near future.
1948 Where the standard specified with
1950 represents a GNU extended dialect of C, such as
1954 there is a corresponding
1956 the version of ISO C on which the GNU extended dialect is based.
1959 are given where they are required by the base standard.
1960 (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.)
1962 .It Fl pedantic-errors
1965 except that errors are produced rather than warnings.
1968 Inhibit all warning messages.
1971 Inhibit warning messages about the use of
1974 .It Fl Wchar-subscripts
1975 Warn if an array subscript has type
1977 This is a common cause of error, as programmers often forget that this type is signed on some machines.
1978 This warning is enabled by
1982 Warn whenever a comment-start sequence
1986 comment, or whenever a Backslash-Newline appears in a
1989 This warning is enabled by
1992 .It Fl Wfatal-errors
1993 This option causes the compiler to abort compilation on the first error occurred rather than trying to keep going and printing further error messages.
2000 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.
2001 This includes standard functions, and others specified by format attributes, in the
2007 (an X/Open extension, not in the C standard) families (or other target-specific families).
2008 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
2013 The formats are checked against the format features supported by GNU libc version 2.2.
2014 These include all ISO C90 and C99 features, as well as features from the Single Unix Specification and some BSD and GNU extensions.
2015 Other library implementations may not support all these features; GCC does not support warning about features that go beyond a particular library's limitations.
2020 warnings will be given about format features not in the selected standard version (but not for
2022 formats, since those are not in any version of the C standard).
2026 also checks for null format arguments for several functions,
2034 For more control over some aspects of format checking, the options
2036 .Fl Wno-format-extra-args ,
2037 .Fl Wno-format-zero-length ,
2038 .Fl Wformat-nonliteral ,
2039 .Fl Wformat-security ,
2042 are available, but are not included in
2048 is specified, also warn about
2050 formats which may yield only a two-digit year.
2052 .It Fl Wno-format-extra-args
2055 is specified, do not warn about excess arguments to a
2060 The C standard specifies that such arguments are ignored.
2062 Where the unused arguments lie between used arguments that are specified with
2064 operand number specifications, normally warnings are still given, since the implementation could not know what type to pass to
2066 to skip the unused arguments.
2067 However, in the case of
2069 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.
2071 .It Fl Wno-format-zero-length
2074 is specified, do not warn about zero-length formats.
2075 The C standard specifies that zero-length formats are allowed.
2077 .It Fl Wformat-nonliteral
2080 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
2083 .It Fl Wformat-security
2086 is specified, also warn about uses of format functions that represent possible security problems.
2087 At present, this warns about calls to
2091 functions where the format string is not a string literal and there are no format arguments, as in
2093 This may be a security hole if the format string came from untrusted input and contains
2095 (This is currently a subset of what
2096 .Fl Wformat-nonliteral
2097 warns about, but in future warnings may be added to
2098 .Fl Wformat-security
2099 that are not included in
2100 .Fl Wformat-nonliteral . )
2105 plus format checks not included in
2107 Currently equivalent to
2108 .Fl Wformat Fl Wformat-nonliteral Fl Wformat-security Fl Wformat-y2k .
2111 Warn about passing a null pointer for arguments marked as requiring a non-null value by the
2120 It can be disabled with the
2124 .It Fl Winit-self (C, C++, Objective-C and Objective-C++ only)
2125 Warn about uninitialized variables which are initialized with themselves.
2126 Note this option can only be used with the
2128 option, which in turn only works with
2132 For example, GCC will warn about
2134 being uninitialized in the following snippet only when
2138 .Bd -literal -offset indent
2145 .It Fl Wimplicit-int
2146 Warn when a declaration does not specify a type.
2147 This warning is enabled by
2150 .It Fl Wimplicit-function-declaration
2151 .It Fl Werror-implicit-function-declaration
2152 Give a warning (or error) whenever a function is used before being declared.
2154 .Fl Wno-error-implicit-function-declaration
2156 This warning is enabled by
2158 (as a warning, not an error).
2164 .Fl Wimplicit-function-declaration .
2165 This warning is enabled by
2173 should be a function with external linkage, returning int, taking either zero arguments, two, or three arguments of appropriate types.
2174 This warning is enabled by
2177 .It Fl Wmissing-braces
2178 Warn if an aggregate or union initializer is not fully bracketed.
2179 In the following example, the initializer for
2181 is not fully bracketed, but that for
2185 .Bd -literal -offset indent
2186 int a[2][2] = { 0, 1, 2, 3 };
2187 int b[2][2] = { { 0, 1 }, { 2, 3 } };
2189 This warning is enabled by
2192 .It Fl Wmissing-include-dirs (C, C++, Objective-C and Objective-C++ only)
2193 Warn if a user-supplied include directory does not exist.
2196 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.
2197 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.
2199 Also warn if a comparison like
2200 .Sy x\*[Lt]=y\*[Lt]=z
2201 appears; this is equivalent to
2202 .Sy (x\*[Lt]=y ? 1 : 0) \*[Lt]= z ,
2203 which is a different interpretation from that of ordinary mathematical notation.
2205 Also warn about constructions where there may be confusion to which
2210 Here is an example of such a case:
2212 .Bd -literal -offset indent
2223 branch belongs to the innermost possible
2225 statement, which in this example is
2227 This is often not what the programmer expected, as illustrated in the above example by indentation the programmer chose.
2228 When there is the potential for this confusion, GCC will issue a warning when this flag is specified.
2229 To eliminate the warning, add explicit braces around the innermost
2231 statement so there is no way the
2233 could belong to the enclosing
2235 The resulting code would look like this:
2237 .Bd -literal -offset indent
2248 This warning is enabled by
2251 .It Fl Wsequence-point
2252 Warn about code that may have undefined semantics because of violations of sequence point rules in the C standard.
2254 The C standard defines the order in which expressions in a C program are evaluated in terms of
2255 .Em sequence points ,
2256 which represent a partial ordering between the execution of parts of the program: those executed before the sequence point, and those executed after it.
2257 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
2263 (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.
2264 Other than as expressed by the sequence point rules, the order of evaluation of subexpressions of an expression is not specified.
2265 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.
2266 However, the standards committee have ruled that function calls do not overlap.
2268 It is not specified when between sequence points modifications to the values of objects take effect.
2269 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.
2270 Furthermore, the prior value shall be read only to determine the value to be stored.".
2271 If a program breaks these rules, the results on any particular implementation are entirely unpredictable.
2273 Examples of code with undefined behavior are
2278 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.
2280 The present implementation of this option only works for C programs.
2281 A future implementation may also work for C++ programs.
2283 The C standard is worded confusingly, therefore there is some debate over the precise meaning of the sequence point rules in subtle cases.
2284 Links to discussions of the problem, including proposed formal definitions, may be found on the GCC readings page, at
2285 .Lk http://gcc.gnu.org/readings.html .
2287 This warning is enabled by
2291 Warn whenever a function is defined with a return-type that defaults to
2295 statement with no return-value in a function whose return-type is not
2298 For C, also warn if the return type of a function has a type qualifier such as
2300 Such a type qualifier has no effect, since the value returned by a function is not an lvalue.
2301 ISO C prohibits qualified
2303 return types on function definitions, so such return types always receive a warning even without this option.
2305 For C++, a function without return type always produces a diagnostic message, even when
2308 The only exceptions are
2310 and functions defined in system headers.
2312 This warning is enabled by
2318 statement has an index of enumerated type and lacks a
2320 for one or more of the named codes of that enumeration.
2323 label prevents this warning.)
2325 labels outside the enumeration range also provoke warnings when this option is used.
2326 This warning is enabled by
2329 .It Fl Wswitch-default
2332 statement does not have a
2339 statement has an index of enumerated type and lacks a
2341 for one or more of the named codes of that enumeration.
2343 labels outside the enumeration range also provoke warnings when this option is used.
2346 Warn if any trigraphs are encountered that might change the meaning of the program (trigraphs within comments are not warned about).
2347 This warning is enabled by
2350 .It Fl Wunused-function
2351 Warn whenever a static function is declared but not defined or a non-inline static function is unused.
2352 This warning is enabled by
2355 .It Fl Wunused-label
2356 Warn whenever a label is declared but not used.
2357 This warning is enabled by
2360 To suppress this warning use the
2364 .It Fl Wunused-parameter
2365 Warn whenever a function parameter is unused aside from its declaration.
2367 To suppress this warning use the
2371 .It Fl Wunused-variable
2372 Warn whenever a local variable or non-constant static variable is unused aside from its declaration.
2373 This warning is enabled by
2376 To suppress this warning use the
2380 .It Fl Wunused-value
2381 Warn whenever a statement computes a result that is explicitly not used.
2382 This warning is enabled by
2385 To suppress this warning cast the expression to
2393 In order to get a warning about an unused function parameter, you must either specify
2394 .Fl Wextra Fl Wunused
2399 or separately specify
2400 .Fl Wunused-parameter .
2402 .It Fl Wuninitialized
2403 Warn if an automatic variable is used without first being initialized or if a variable may be clobbered by a
2407 These warnings are possible only in optimizing compilation, because they require data flow information that is computed only when optimizing.
2408 If you don't specify
2410 you simply won't get these warnings.
2412 If you want to warn about code which uses the uninitialized value of the variable in its own initializer, use the
2416 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.
2417 They do not occur for variables or elements declared
2419 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.
2421 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.
2423 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.
2424 Here is one example of how this can happen:
2426 .Bd -literal -offset indent
2442 is always 1, 2 or 3, then
2444 is always initialized, but GCC doesn't know this.
2445 Here is another common case:
2447 .Bd -literal -offset indent
2450 if (change_y) save_y = y, y = new_y;
2452 if (change_y) y = save_y;
2455 This has no bug because
2457 is used only if it is set.
2459 This option also warns when a non-volatile automatic variable might be changed by a call to
2461 These warnings as well are possible only in optimizing compilation.
2463 The compiler sees only the calls to
2465 It cannot know where
2467 will be called; in fact, a signal handler could call it at any point in the code.
2468 As a result, you may get a warning even when there is in fact no problem because
2470 cannot in fact be called at the place which would cause a problem.
2472 Some spurious warnings can be avoided if you declare all the functions you use that never return as
2475 This warning is enabled by
2478 .It Fl Wunknown-pragmas
2479 Warn when a #pragma directive is encountered which is not understood by GCC.
2480 If this command line option is used, warnings will even be issued for unknown pragmas in system header files.
2481 This is not the case if the warnings were only enabled by the
2483 command line option.
2486 Do not warn about misuses of pragmas, such as incorrect parameters, invalid syntax, or conflicts between pragmas.
2488 .Fl Wunknown-pragmas .
2490 .It Fl Wstrict-aliasing
2491 This option is only active when
2492 .Fl fstrict-aliasing
2494 It warns about code which might break the strict aliasing rules that the compiler is using for optimization.
2495 The warning does not catch all cases, but does attempt to catch the more common pitfalls.
2499 .It Fl Wstrict-aliasing=2
2500 This option is only active when
2501 .Fl fstrict-aliasing
2503 It warns about code which might break the strict aliasing rules that the compiler is using for optimization.
2504 This warning catches more cases than
2505 .Fl Wstrict-aliasing ,
2506 but it will also give a warning for some ambiguous cases that are safe.
2512 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.
2513 This also enables some language-specific warnings described in
2514 .Sy C++ Dialect Options
2516 .Sy Objective-C and Objective-C++ Dialect Options .
2521 options are not implied by
2523 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.
2527 (This option used to be called
2529 The older name is still supported, but the newer name is more descriptive.) Print extra warning messages for these events:
2533 A function can return either with or without a value.
2534 (Falling off the end of the function body is considered returning without a value.) For example, this function would evoke such a warning:
2536 .Bd -literal -offset indent
2544 An expression-statement or the left-hand side of a comma expression contains no side effects.
2545 To suppress the warning, cast the unused expression to void.
2546 For example, an expression such as
2548 will cause a warning, but
2553 An unsigned value is compared against zero with
2559 Storage-class specifiers like
2561 are not the first things in a declaration.
2562 According to the C Standard, this usage is obsolescent.
2569 is also specified, warn about unused arguments.
2572 A comparison between signed and unsigned values could produce an incorrect result when the signed value is converted to unsigned.
2574 .Fl Wno-sign-compare
2578 An aggregate has an initializer which does not initialize all members.
2579 This warning can be independently controlled by
2580 .Fl Wmissing-field-initializers .
2583 A function parameter is declared without a type specifier in K&R-style functions:
2585 .Bd -literal -offset indent
2589 An empty body occurs in an
2596 A pointer is compared against integer zero with
2604 A variable might be changed by
2610 Any of several floating-point events that often indicate errors, such as overflow, underflow, loss of precision, etc.
2613 An enumerator and a non-enumerator both appear in a conditional expression.
2616 A non-static reference or non-static
2618 member appears in a class without constructors.
2621 Ambiguous virtual bases.
2624 Subscripting an array which has been declared
2628 Taking the address of a variable which has been declared
2632 A base class is not initialized in a derived class' copy constructor.
2635 .It Fl Wno-div-by-zero
2636 Do not warn about compile-time integer division by zero.
2637 Floating point division by zero is not warned about, as it can be a legitimate way of obtaining infinities and NaNs.
2639 .It Fl Wsystem-headers
2640 Print warning messages for constructs found in system header files.
2641 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.
2642 Using this command line option tells GCC to emit warnings from system headers as if they occurred in user code.
2643 However, note that using
2645 in conjunction with this option will
2647 warn about unknown pragmas in system headers---for that,
2648 .Fl Wunknown-pragmas
2652 Warn if floating point values are used in equality comparisons.
2654 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.
2655 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).
2656 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.
2658 .It Fl Wtraditional (C only)
2659 Warn about certain constructs that behave differently in traditional and ISO C.
2660 Also warn about ISO C constructs that have no traditional C equivalent, and/or problematic constructs which should be avoided.
2664 Macro parameters that appear within string literals in the macro body.
2665 In traditional C macro replacement takes place within string literals, but does not in ISO C.
2668 In traditional C, some preprocessor directives did not exist.
2669 Traditional preprocessors would only consider a line to be a directive if the
2671 appeared in column 1 on the line.
2674 warns about directives that traditional C understands but would ignore because the
2676 does not appear as the first character on the line.
2677 It also suggests you hide directives like
2679 not understood by traditional C by indenting them.
2680 Some traditional implementations would not recognize
2682 so it suggests avoiding it altogether.
2685 A function-like macro that appears without arguments.
2688 The unary plus operator.
2693 integer constant suffix, or the
2697 floating point constant suffixes.
2698 (Traditional C does support the
2700 suffix on integer constants.) Note, these suffixes appear in macros defined in the system headers of most modern systems, e.g. the
2705 .Va \*[Lt]limits.h\*[Gt] .
2706 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.
2709 A function declared external in one block and then used after the end of the block.
2714 statement has an operand of type
2720 function declaration follows a
2723 This construct is not accepted by some traditional C compilers.
2726 The ISO type of an integer constant has a different width or signedness from its traditional type.
2727 This warning is only issued if the base of the constant is ten.
2728 I.e. hexadecimal or octal values, which typically represent bit patterns, are not warned about.
2731 Usage of ISO string concatenation is detected.
2734 Initialization of automatic aggregates.
2737 Identifier conflicts with labels.
2738 Traditional C lacks a separate namespace for labels.
2741 Initialization of unions.
2742 If the initializer is zero, the warning is omitted.
2743 This is done under the assumption that the zero initializer in user code appears conditioned on e.g.
2745 to avoid missing initializer warnings and relies on default initialization to zero in the traditional C case.
2748 Conversions by prototypes between fixed/floating point values and vice versa.
2749 The absence of these prototypes when compiling with traditional C would cause serious problems.
2750 This is a subset of the possible conversion warnings, for the full set use
2754 Use of ISO C style function definitions.
2755 This warning intentionally is
2757 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,
2761 This warning is also bypassed for nested functions because that feature is already a GCC extension and thus not relevant to traditional C compatibility.
2764 .It Fl Wdeclaration-after-statement (C only)
2765 Warn when a declaration is found after a statement in a block.
2766 This construct, known from C++, was introduced with ISO C99 and is by default allowed in GCC.
2767 It is not supported by ISO C90 and was not supported by GCC versions before GCC 3.0.
2770 Warn if an undefined identifier is evaluated in an
2774 .It Fl Wno-endif-labels
2775 Do not warn whenever an
2779 are followed by text.
2782 Warn whenever a local variable shadows another local variable, parameter or global variable or whenever a built-in function is shadowed.
2784 .It Fl Wlarger-than- Ns Ar len
2785 Warn whenever an object of larger than
2789 .It Fl Wunsafe-loop-optimizations
2790 Warn if the loop cannot be optimized because the compiler could not assume anything on the bounds of the loop indices.
2792 .Fl funsafe-loop-optimizations
2793 warn if the compiler made such assumptions.
2795 .It Fl Wpointer-arith
2796 Warn about anything that depends on the "size of" a function type or of
2798 GNU C assigns these types a size of 1, for convenience in calculations with
2800 pointers and pointers to functions.
2802 .It Fl Wbad-function-cast (C only)
2803 Warn whenever a function call is cast to a non-matching type.
2804 For example, warn if
2810 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
2812 to a pointer to non-
2817 Warn whenever a pointer is cast so as to remove a type qualifier from the target type.
2818 For example, warn if a
2820 is cast to an ordinary
2824 Warn whenever a pointer is cast such that the required alignment of the target is increased.
2825 For example, warn if a
2829 on machines where integers can only be accessed at two- or four-byte boundaries.
2831 .It Fl Wwrite-strings
2832 When compiling C, give string constants the type
2833 .Va const char [length]
2834 so that copying the address of one into a non-
2836 pointer will get a warning; when compiling C++, warn about the deprecated conversion from string constants to
2838 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
2840 in declarations and prototypes.
2841 Otherwise, it will just be a nuisance; this is why we did not make
2843 request these warnings.
2846 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.
2847 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.
2849 Also, warn if a negative integer constant expression is implicitly converted to an unsigned type.
2850 For example, warn about the assignment
2855 But do not warn about explicit casts like
2858 .It Fl Wsign-compare
2859 Warn when a comparison between signed and unsigned values could produce an incorrect result when the signed value is converted to unsigned.
2860 This warning is also enabled by
2862 to get the other warnings of
2864 without this warning, use
2865 .Fl Wextra Fl Wno-sign-compare .
2867 .It Fl Waggregate-return
2868 Warn if any functions that return structures or unions are defined or called.
2869 (In languages where you can return an array, this also elicits a warning.)
2871 .It Fl Wno-attributes
2872 Do not warn if an unexpected
2874 is used, such as unrecognized attributes, function attributes applied to variables, etc.
2875 This will not stop errors for incorrect use of supported attributes.
2877 .It Fl Wstrict-prototypes (C only)
2878 Warn if a function is declared or defined without specifying the argument types.
2879 (An old-style function definition is permitted without a warning if preceded by a declaration which specifies the argument types.)
2881 .It Fl Wold-style-definition (C only)
2882 Warn if an old-style function definition is used.
2883 A warning is given even if there is a previous prototype.
2885 .It Fl Wmissing-prototypes (C only)
2886 Warn if a global function is defined without a previous prototype declaration.
2887 This warning is issued even if the definition itself provides a prototype.
2888 The aim is to detect global functions that fail to be declared in header files.
2890 .It Fl Wmissing-declarations (C only)
2891 Warn if a global function is defined without a previous declaration.
2892 Do so even if the definition itself provides a prototype.
2893 Use this option to detect global functions that are not declared in header files.
2895 .It Fl Wmissing-field-initializers
2896 Warn if a structure's initializer has some fields missing.
2897 For example, the following code would cause such a warning, because
2901 .Bd -literal -offset indent
2902 struct s { int f, g, h; };
2903 struct s x = { 3, 4 };
2905 This option does not warn about designated initializers, so the following modification would not trigger a warning:
2907 .Bd -literal -offset indent
2908 struct s { int f, g, h; };
2909 struct s x = { .f = 3, .g = 4 };
2911 This warning is included in
2915 warnings without this one, use
2916 .Fl Wextra Fl Wno-missing-field-initializers .
2918 .It Fl Wmissing-noreturn
2919 Warn about functions which might be candidates for attribute
2921 Note these are only possible candidates, not absolute ones.
2922 Care should be taken to manually verify functions actually do not ever return before adding the
2924 attribute, otherwise subtle code generation bugs could be introduced.
2925 You will not get a warning for
2927 in hosted C environments.
2929 .It Fl Wmissing-format-attribute
2930 Warn about function pointers which might be candidates for
2933 Note these are only possible candidates, not absolute ones.
2934 GCC will guess that function pointers with
2936 attributes that are used in assignment, initialization, parameter passing or return statements should have a corresponding
2938 attribute in the resulting type.
2939 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
2941 attribute to avoid the warning.
2943 GCC will also warn about function definitions which might be candidates for
2946 Again, these are only possible candidates.
2949 attributes might be appropriate for any function that calls a function like
2953 but this might not always be the case, and some functions for which
2955 attributes are appropriate may not be detected.
2957 .It Fl Wno-multichar
2958 Do not warn if a multicharacter constant
2961 Usually they indicate a typo in the user's code, as they have implementation-defined values, and should not be used in portable code.
2963 .It Sy -Wnormalized=\*[Lt]none|id|nfc|nfkc\*[Gt] Ns
2964 In ISO C and ISO C++, two identifiers are different if they are different sequences of characters.
2965 However, sometimes when characters outside the basic ASCII character set are used, you can have two different character sequences that look the same.
2966 To avoid confusion, the ISO 10646 standard sets out some
2967 .Em normalization rules
2968 which when applied ensure that two sequences that look the same are turned into the same sequence.
2969 GCC can warn you if you are using identifiers which have not been normalized; this option controls that warning.
2971 There are four levels of warning that GCC supports.
2973 .Fl Wnormalized=nfc ,
2974 which warns about any identifier which is not in the ISO 10646 "C" normalized form,
2976 NFC is the recommended form for most uses.
2978 Unfortunately, there are some characters which ISO C and ISO C++ allow in identifiers that when turned into NFC aren't allowable as identifiers.
2979 That is, there's no way to use these symbols in portable ISO C or C++ and have all your identifiers in NFC.
2981 suppresses the warning for these characters.
2982 It is hoped that future versions of the standards involved will correct this, which is why this option is not the default.
2984 You can switch the warning off for all characters by writing
2985 .Fl Wnormalized=none .
2986 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.
2988 Some characters in ISO 10646 have distinct meanings but look identical in some fonts or display methodologies, especially once formatting has been applied.
2991 "SUPERSCRIPT LATIN SMALL LETTER N", will display just like a regular
2993 which has been placed in a superscript.
2994 ISO 10646 defines the
2996 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
2997 .Fl Wnormalized=nfkc .
2998 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.
3000 .It Fl Wno-deprecated-declarations
3001 Do not warn about uses of functions, variables, and types marked as deprecated by using the
3004 (@pxref{Function Attributes}, @pxref{Variable Attributes}, @pxref{Type Attributes}.)
3007 Warn if a structure is given the packed attribute, but the packed attribute has no effect on the layout or size of the structure.
3008 Such structures may be mis-aligned for little benefit.
3009 For instance, in this code, the variable
3013 will be misaligned even though
3015 does not itself have the packed attribute:
3017 .Bd -literal -offset indent
3021 } __attribute__((packed));
3028 Warn if padding is included in a structure, either to align an element of the structure or to align the whole structure.
3029 Sometimes when this happens it is possible to rearrange the fields of the structure to reduce the padding and so make the structure smaller.
3031 .It Fl Wredundant-decls
3032 Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing.
3034 .It Fl Wnested-externs (C only)
3037 declaration is encountered within a function.
3039 .It Fl Wunreachable-code
3040 Warn if the compiler detects that code will never be executed.
3042 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.
3044 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.
3046 For instance, when a function is inlined, a warning may mean that the line is unreachable in only one inlined copy of the function.
3048 This option is not made part of
3050 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.
3051 Another common use of unreachable code is to provide behavior which is selectable at compile-time.
3054 Warn if a function can not be inlined and it was declared as inline.
3055 Even with this option, the compiler will not warn about failures to inline functions declared in system headers.
3057 The compiler uses a variety of heuristics to determine whether or not to inline a function.
3058 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.
3059 Therefore, seemingly insignificant changes in the source program can cause the warnings produced by
3061 to appear or disappear.
3063 .It Fl Wno-invalid-offsetof (C++ only)
3064 Suppress warnings from applying the
3066 macro to a non-POD type.
3067 According to the 1998 ISO C++ standard, applying
3069 to a non-POD type is undefined.
3070 In existing C++ implementations, however,
3072 typically gives meaningful results even when applied to certain kinds of non-POD types. (Such as a simple
3074 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.
3078 may be relaxed in a future version of the C++ standard.
3080 .It Fl Wno-int-to-pointer-cast (C only)
3081 Suppress warnings from casts to pointer type of an integer of a different size.
3083 .It Fl Wno-pointer-to-int-cast (C only)
3084 Suppress warnings from casts from a pointer to an integer type of a different size.
3087 Warn if a precompiled header is found in the search path but can't be used.
3094 To inhibit the warning messages, use
3100 are taken into account only when
3104 .It Fl Wvariadic-macros
3105 Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU alternate syntax when in pedantic ISO C99 mode.
3107 To inhibit the warning messages, use
3108 .Fl Wno-variadic-macros .
3110 .It Fl Wvolatile-register-var
3111 Warn if a register variable is declared volatile.
3112 The volatile modifier does not inhibit all optimizations that may eliminate reads and/or writes to register variables.
3114 .It Fl Wdisabled-optimization
3115 Warn if a requested optimization pass is disabled.
3116 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.
3117 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.
3119 .It Fl Wpointer-sign
3120 Warn for pointer argument passing or assignment with different signedness.
3121 This option is only supported for C and Objective-C.
3126 which can be disabled with
3127 .Fl Wno-pointer-sign .
3130 Make all warnings into errors.
3132 .It Fl Wstack-protector
3133 This option is only active when
3134 .Fl fstack-protector
3136 It warns about functions that will not be protected against stack smashing.
3139 .Ss Options for Debugging Your Program or GCC
3140 GCC has various special options that are used for debugging either your program or GCC:
3144 Produce debugging information in the operating system's native format (stabs, COFF, XCOFF, or DWARF 2).
3145 GDB can work with this debugging information.
3147 On most systems that use stabs format,
3149 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.
3150 If you want to control for certain whether to generate the extra information, use
3159 GCC allows you to use
3163 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.
3165 Nevertheless it proves possible to debug optimized output.
3166 This makes it reasonable to use the optimizer for programs that might have bugs.
3168 The following options are useful when GCC is generated with the capability for more than one debugging format.
3171 Produce debugging information for use by GDB.
3172 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.
3175 Produce debugging information in stabs format (if that is supported), without GDB extensions.
3176 This is the format used by DBX on most BSD systems.
3177 On MIPS, Alpha and System V Release 4 systems this option produces stabs debugging output which is not understood by DBX or SDB.
3178 On System V Release 4 systems this option requires the GNU assembler.
3180 .It Fl feliminate-unused-debug-symbols
3181 Produce debugging information in stabs format (if that is supported), for only symbols that are actually used.
3184 Produce debugging information in stabs format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB).
3185 The use of these extensions is likely to make other debuggers crash or refuse to read the program.
3188 Produce debugging information in COFF format (if that is supported).
3189 This is the format used by SDB on most System V systems prior to System V Release 4.
3192 Produce debugging information in XCOFF format (if that is supported).
3193 This is the format used by the DBX debugger on IBM RS/6000 systems.
3196 Produce debugging information in XCOFF format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB).
3197 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.
3200 Produce debugging information in DWARF version 2 format (if that is supported).
3201 This is the format used by DBX on IRIX 6.
3202 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.
3205 Produce debugging information in VMS debug format (if that is supported).
3206 This is the format used by DEBUG on VMS systems.
3208 .It Fl g Ns Ar level
3209 .It Fl ggdb Ns Ar level
3210 .It Fl gstabs Ns Ar level
3211 .It Fl gcoff Ns Ar level
3212 .It Fl gxcoff Ns Ar level
3213 .It Fl gvms Ns Ar level
3214 Request debugging information and also use
3216 to specify how much information.
3217 The default level is 2.
3219 Level 1 produces minimal information, enough for making backtraces in parts of the program that you don't plan to debug.
3220 This includes descriptions of functions and external variables, but no information about local variables and no line numbers.
3222 Level 3 includes extra information, such as all the macro definitions present in the program.
3223 Some debuggers support macro expansion when you use
3227 does not accept a concatenated debug level, because GCC used to support an option
3229 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.
3230 That debug format is long obsolete, but the option cannot be changed now.
3231 Instead use an additional
3233 option to change the debug level for DWARF2.
3235 .It Fl feliminate-dwarf2-dups
3236 Compress DWARF2 debugging information by eliminating duplicated information about each symbol.
3237 This option only makes sense when generating DWARF2 debugging information with
3241 Generate extra code to write profile information suitable for the analysis program
3243 You must use this option when compiling the source files you want data about, and you must also use it when linking.
3246 Generate extra code to write profile information suitable for the analysis program
3248 You must use this option when compiling the source files you want data about, and you must also use it when linking.
3251 Makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes.
3254 Makes the compiler print some statistics about the time consumed by each pass when it finishes.
3257 Makes the compiler print some statistics about permanent memory allocation when it finishes.
3259 .It Fl fprofile-arcs
3260 Add code so that program flow
3263 During execution the program records how many times each branch and call is executed and how many times it is taken or returns.
3264 When the compiled program exits it saves this data to a file called
3266 for each source file.
3267 The data may be used for profile-directed optimizations
3268 .Fl ( fbranch-probabilities ) ,
3269 or for test coverage analysis
3270 .Fl ( ftest-coverage ) .
3273 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.
3274 In both cases any suffix is removed (e.g.
3280 for output file specified as
3281 .Sy -o dir/foo.o ) .
3284 This option is used to compile and link code instrumented for coverage analysis.
3285 The option is a synonym for
3288 (when compiling) and
3291 See the documentation for those options for more details.
3295 Compile the source files with
3297 plus optimization and code generation options.
3298 For test coverage analysis, use the additional
3301 You do not need to profile every source file in a program.
3304 Link your object files with
3308 (the latter implies the former).
3311 Run the program on a representative workload to generate the arc profile information.
3312 This may be repeated any number of times.
3313 You can run concurrent instances of your program, and provided that the file system supports locking, the data files will be correctly updated.
3316 calls are detected and correctly handled (double counting will not happen).
3319 For profile-directed optimizations, compile the source files again with the same optimization and code generation options plus
3320 .Fl fbranch-probabilities .
3323 For test coverage analysis, use
3325 to produce human readable information from the
3332 documentation for further information.
3337 for each function of your program GCC creates a program flow graph, then finds a spanning tree for the graph.
3338 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.
3339 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.
3341 .It Fl ftest-coverage
3342 Produce a notes file that the
3344 code-coverage utility can use to show program coverage.
3345 Each source file's note file is called
3349 option above for a description of
3351 and instructions on how to generate test coverage data.
3352 Coverage data will match the source files more closely, if you do not optimize.
3354 .It Fl d Ns Ar letters
3355 .It Fl fdump-rtl- Ns Ar pass
3356 Says to make debugging dumps during compilation at times specified by
3358 This is used for debugging the RTL-based passes of the compiler.
3359 The file names for most of the dumps are made by appending a pass number and a word to the
3362 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.
3364 Most debug dumps can be enabled either passing a letter to the
3366 option, or with a long
3368 switch; here are the possible letters for use in
3376 Annotate the assembler output with miscellaneous debugging information.
3380 Dump after computing branch probabilities, to
3384 .It Fl fdump-rtl-bbro
3385 Dump after block reordering, to
3389 .It Fl fdump-rtl-combine
3390 Dump after instruction combination, to the file
3391 .Pa file.17.combine .
3394 .It Fl fdump-rtl-ce1
3395 .It Fl fdump-rtl-ce2
3399 enable dumping after the first if conversion, to the file
3404 enable dumping after the second if conversion, to the file
3408 .It Fl fdump-rtl-btl
3409 .It Fl fdump-rtl-dbr
3413 enable dumping after branch target load optimization, to
3418 enable dumping after delayed branch scheduling, to
3422 Dump all macro definitions, at the end of preprocessing, in addition to normal output.
3425 .It Fl fdump-rtl-ce3
3426 Dump after the third if conversion, to
3430 .It Fl fdump-rtl-cfg
3431 .It Fl fdump-rtl-life
3435 enable dumping after control and data flow analysis, to
3440 enable dumping dump after life analysis, to
3444 .It Fl fdump-rtl-greg
3445 Dump after global register allocation, to
3449 .It Fl fdump-rtl-gcse
3450 .It Fl fdump-rtl-bypass
3454 enable dumping after GCSE, to
3458 .Fl fdump-rtl-bypass
3459 enable dumping after jump bypassing and control flow optimizations, to
3460 .Pa file.07.bypass .
3464 Dump after finalization of EH handling code, to
3468 .It Fl fdump-rtl-sibling
3469 Dump after sibling call optimizations, to
3470 .Pa file.01.sibling .
3473 .It Fl fdump-rtl-jump
3474 Dump after the first jump optimization, to
3478 .It Fl fdump-rtl-stack
3479 Dump after conversion from registers to stack, to
3483 .It Fl fdump-rtl-lreg
3484 Dump after local register allocation, to
3488 .It Fl fdump-rtl-loop
3489 .It Fl fdump-rtl-loop2
3493 enable dumping after the first loop optimization pass, to
3498 enable dumping after the second pass, to
3502 .It Fl fdump-rtl-sms
3503 Dump after modulo scheduling, to
3507 .It Fl fdump-rtl-mach
3508 Dump after performing the machine dependent reorganization pass, to
3512 .It Fl fdump-rtl-rnreg
3513 Dump after register renumbering, to
3517 .It Fl fdump-rtl-regmove
3518 Dump after the register move pass, to
3519 .Pa file.19.regmove .
3522 .It Fl fdump-rtl-postreload
3523 Dump after post-reload optimizations, to
3524 .Pa file.24.postreload .
3527 .It Fl fdump-rtl-expand
3528 Dump after RTL generation, to
3529 .Pa file.00.expand .
3532 .It Fl fdump-rtl-sched2
3533 Dump after the second scheduling pass, to
3534 .Pa file.32.sched2 .
3537 .It Fl fdump-rtl-cse
3538 Dump after CSE (including the jump optimization that sometimes follows CSE), to
3542 .It Fl fdump-rtl-sched
3543 Dump after the first scheduling pass, to
3547 .It Fl fdump-rtl-cse2
3548 Dump after the second CSE pass (including the jump optimization that sometimes follows CSE), to
3552 .It Fl fdump-rtl-tracer
3553 Dump after running tracer, to
3554 .Pa file.12.tracer .
3557 .It Fl fdump-rtl-vpt
3558 .It Fl fdump-rtl-vartrack
3562 enable dumping after the value profile transformations, to
3566 .Fl fdump-rtl-vartrack
3567 enable dumping after variable tracking, to
3568 .Pa file.34.vartrack .
3571 .It Fl fdump-rtl-flow2
3572 Dump after the second flow pass, to
3576 .It Fl fdump-rtl-peephole2
3577 Dump after the peephole pass, to
3578 .Pa file.27.peephole2 .
3581 .It Fl fdump-rtl-web
3582 Dump after live range splitting, to
3586 .It Fl fdump-rtl-all
3587 Produce all the dumps listed above.
3590 Produce a core dump whenever an error occurs.
3593 Print statistics on memory usage, at the end of the run, to standard error.
3596 Annotate the assembler output with a comment indicating which pattern and alternative was used.
3597 The length of each instruction is also printed.
3600 Dump the RTL in the assembler output as a comment before each instruction.
3606 For each of the other indicated dump files (either with
3609 .Fl fdump-rtl- Ns Ar pass ) ,
3610 dump a representation of the control flow graph suitable for viewing with VCG to
3614 Just generate RTL for a function instead of compiling it.
3617 .Fl ( fdump-rtl-expand ) .
3620 Dump debugging information during parsing, to standard error.
3623 .It Fl fdump-unnumbered
3624 When doing debugging dumps (see
3626 option above), suppress instruction numbers and line number note output.
3627 This makes it more feasible to use diff on debugging dumps for compiler invocations with different options, in particular with and without
3630 .It Fl fdump-translation-unit (C++ only)
3631 .It Fl fdump-translation-unit- Ns Ar options \~(C++ only)
3632 Dump a representation of the tree structure for the entire translation unit to a file.
3633 The file name is made by appending
3635 to the source file name.
3641 controls the details of the dump as described for the
3645 .It Fl fdump-class-hierarchy (C++ only)
3646 .It Fl fdump-class-hierarchy- Ns Ar options \~(C++ only)
3647 Dump a representation of each class's hierarchy and virtual function table layout to a file.
3648 The file name is made by appending
3650 to the source file name.
3656 controls the details of the dump as described for the
3660 .It Fl fdump-ipa- Ns Ar switch
3661 Control the dumping at various stages of inter-procedural analysis language tree to a file.
3662 The file name is generated by appending a switch specific suffix to the source file name.
3663 The following dumps are possible:
3667 Enables all inter-procedural analysis dumps; currently the only produced dump is the
3672 Dumps information about call-graph optimization, unused function removal, and inlining decisions.
3675 .It Fl fdump-tree- Ns Ar switch
3676 .It Fl fdump-tree- Ns Ar switch Ns - Ns Ar options
3677 Control the dumping at various stages of processing the intermediate language tree to a file.
3678 The file name is generated by appending a switch specific suffix to the source file name.
3686 separated options that control the details of the dump.
3687 Not all options are applicable to all dumps, those which are not meaningful will be ignored.
3688 The following options are available
3692 Print the address of each node.
3693 Usually this is not meaningful as it changes according to the environment and source file.
3694 Its primary use is for tying up a dump file with a debug environment.
3697 Inhibit dumping of members of a scope or body of a function merely because that scope has been reached.
3698 Only dump such items when they are directly reachable by some other path.
3699 When dumping pretty-printed trees, this option inhibits dumping the bodies of control structures.
3702 Print a raw representation of the tree.
3703 By default, trees are pretty-printed into a C-like representation.
3706 Enable more detailed dumps (not honored by every dump option).
3709 Enable dumping various statistics about the pass (not honored by every dump option).
3712 Enable showing basic block boundaries (disabled in raw dumps).
3715 Enable showing virtual operands for every statement.
3718 Enable showing line numbers for statements.
3721 Enable showing the unique ID
3726 Turn on all options, except
3733 The following tree dumps are possible:
3737 Dump before any tree based optimization, to
3741 Dump after all tree based optimization, to
3742 .Pa file.optimized .
3745 Dump after function inlining, to
3749 Dump each function before and after the gimplification pass to a file.
3750 The file name is made by appending
3752 to the source file name.
3755 Dump the control flow graph of each function to a file.
3756 The file name is made by appending
3758 to the source file name.
3761 Dump the control flow graph of each function to a file in VCG format.
3762 The file name is made by appending
3764 to the source file name.
3765 Note that if the file contains more than one function, the generated file cannot be used directly by VCG.
3766 You will need to cut and paste each function's graph into its own separate file first.
3769 Dump each function after copying loop headers.
3770 The file name is made by appending
3772 to the source file name.
3775 Dump SSA related information to a file.
3776 The file name is made by appending
3778 to the source file name.
3781 Dump structure aliasing variable information to a file.
3782 This file name is made by appending
3784 to the source file name.
3787 Dump aliasing information for each function.
3788 The file name is made by appending
3790 to the source file name.
3793 Dump each function after CCP.
3794 The file name is made by appending
3796 to the source file name.
3799 Dump each function after STORE-CCP.
3800 The file name is made by appending
3802 to the source file name.
3805 Dump trees after partial redundancy elimination.
3806 The file name is made by appending
3808 to the source file name.
3811 Dump trees after full redundancy elimination.
3812 The file name is made by appending
3814 to the source file name.
3817 Dump trees after copy propagation.
3818 The file name is made by appending
3820 to the source file name.
3822 .It Sy store_copyprop Ns
3823 Dump trees after store copy-propagation.
3824 The file name is made by appending
3826 to the source file name.
3829 Dump each function after dead code elimination.
3830 The file name is made by appending
3832 to the source file name.
3835 Dump each function after adding mudflap instrumentation.
3836 The file name is made by appending
3838 to the source file name.
3841 Dump each function after performing scalar replacement of aggregates.
3842 The file name is made by appending
3844 to the source file name.
3847 Dump each function after performing code sinking.
3848 The file name is made by appending
3850 to the source file name.
3853 Dump each function after applying dominator tree optimizations.
3854 The file name is made by appending
3856 to the source file name.
3859 Dump each function after applying dead store elimination.
3860 The file name is made by appending
3862 to the source file name.
3865 Dump each function after optimizing PHI nodes into straightline code.
3866 The file name is made by appending
3868 to the source file name.
3871 Dump each function after forward propagating single use variables.
3872 The file name is made by appending
3874 to the source file name.
3876 .It Sy copyrename Ns
3877 Dump each function after applying the copy rename optimization.
3878 The file name is made by appending
3880 to the source file name.
3883 Dump each function after applying the named return value optimization on generic trees.
3884 The file name is made by appending
3886 to the source file name.
3889 Dump each function after applying vectorization of loops.
3890 The file name is made by appending
3892 to the source file name.
3895 Dump each function after Value Range Propagation (VRP).
3896 The file name is made by appending
3898 to the source file name.
3901 Enable all the available tree dumps with the flags provided in this option.
3904 .It Fl ftree-vectorizer-verbose= Ns Ar n
3905 This option controls the amount of debugging output the vectorizer prints.
3906 This information is written to standard error, unless
3910 is specified, in which case it is output to the usual dump listing file,
3913 .It Fl frandom-seed= Ns Ar string
3914 This option provides a seed that GCC uses when it would otherwise use random numbers.
3915 It is used to generate certain symbol names that have to be different in every compiled file.
3916 It is also used to place unique stamps in coverage data files and the object files that produce them.
3919 option to produce reproducibly identical object files.
3923 should be different for every file you compile.
3925 .It Fl fsched-verbose= Ns Ar n
3926 On targets that use instruction scheduling, this option controls the amount of debugging output the scheduler prints.
3927 This information is written to standard error, unless
3931 is specified, in which case it is output to the usual dump listing file,
3938 greater than nine, the output is always printed to standard error.
3944 outputs the same information as
3948 greater than one, it also output basic block probabilities, detailed ready list information and unit/insn info.
3951 greater than two, it includes RTL at abort point, control-flow and regions info.
3956 also includes dependence info.
3959 Store the usual "temporary" intermediate files permanently; place them in the current directory and name them based on the source file.
3970 This creates a preprocessed
3972 output file even though the compiler now normally uses an integrated preprocessor.
3974 When used in combination with the
3976 command line option,
3978 is sensible enough to avoid over writing an input source file with the same extension as an intermediate file.
3979 The corresponding intermediate file may be obtained by renaming the source file before using
3983 Report the CPU time taken by each subprocess in the compilation sequence.
3984 For C source files, this is the compiler proper and assembler (plus the linker if linking is done).
3985 The output looks like this:
3987 .Bd -literal -offset indent
3991 The first number on each line is the "user time", that is time spent executing the program itself.
3992 The second number is "system time", time spent executing operating system routines on behalf of the program.
3993 Both numbers are in seconds.
3995 .It Fl fvar-tracking
3996 Run variable tracking pass.
3997 It computes where variables are stored at each position in code.
3998 Better debugging information is then generated (if the debugging information format supports this information).
4000 It is enabled by default when compiling with optimization
4004 debugging information
4006 and the debug info format supports it.
4008 .It Fl print-file-name= Ns Ar library
4009 Print the full absolute name of the library file
4011 that would be used when linking---and don't do anything else.
4012 With this option, GCC does not compile or link anything; it just prints the file name.
4014 .It Fl print-multi-directory
4015 Print the directory name corresponding to the multilib selected by any other switches present in the command line.
4016 This directory is supposed to exist in
4017 .Sy GCC_EXEC_PREFIX .
4019 .It Fl print-multi-lib
4020 Print the mapping from multilib directory names to compiler switches that enable them.
4021 The directory name is separated from the switches by
4023 and each switch starts with an
4024 .Sy @} instead of the @samp{- ,
4025 without spaces between multiple switches.
4026 This is supposed to ease shell-processing.
4028 .It Fl print-prog-name= Ns Ar program
4030 .Fl print-file-name ,
4031 but searches for a program such as
4034 .It Fl print-libgcc-file-name
4036 .Sy -print-file-name=libgcc.a .
4038 This is useful when you use
4042 but you do want to link with
4046 .Bd -literal -offset indent
4047 gcc -nostdlib \*[Lt]files\*[Gt]... `gcc -print-libgcc-file-name`
4049 .It Fl print-search-dirs
4050 Print the name of the configured installation directory and a list of program and library directories
4052 will search---and don't do anything else.
4056 prints the error message
4057 .Sy installation problem, cannot exec cpp0: No such file or directory .
4058 To resolve this you either need to put
4060 and the other compiler components where
4062 expects to find them, or you can set the environment variable
4064 to the directory where you installed them.
4065 Don't forget the trailing
4069 Print the compiler's target machine (for example,
4070 .Sy i686-pc-linux-gnu )
4071 ---and don't do anything else.
4074 Print the compiler version (for example,
4076 ---and don't do anything else.
4079 Print the compiler's built-in specs---and don't do anything else.
4080 (This is used when GCC itself is being built.)
4082 .It Fl feliminate-unused-debug-types
4083 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.
4084 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).
4085 More often, however, this results in a significant amount of wasted space.
4086 With this option, GCC will avoid producing debug symbol output for types that are nowhere used in the source file being compiled.
4089 .Ss Options That Control Optimization
4090 These options control various sorts of optimizations.
4092 Without any optimization option, the compiler's goal is to reduce the cost of compilation and to make debugging produce the expected results.
4093 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.
4095 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.
4097 The compiler performs optimization based on the knowledge it has of the program.
4100 and above, in particular, enable
4102 mode, which allows the compiler to consider information gained from later functions in the file when compiling a function.
4103 Compiling multiple files at once to a single output file in
4105 mode allows the compiler to use information gained from all of the files when compiling each of them.
4107 Not all optimizations are controlled directly by a flag.
4108 Only optimizations that have a flag are listed.
4114 Optimizing compilation takes somewhat more time, and a lot more memory for a large function.
4118 the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time.
4121 turns on the following optimization flags:
4122 .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
4126 .Fl fomit-frame-pointer
4127 on machines where doing so does not interfere with debugging.
4132 for the Ada compiler.
4133 This option must be explicitly specified on the command line to be enabled for the Ada compiler.
4137 GCC performs nearly all supported optimizations that do not involve a space-speed tradeoff.
4138 The compiler does not perform loop unrolling or function inlining when you specify
4142 this option increases both compilation time and the performance of the generated code.
4145 turns on all optimization flags specified by
4147 It also turns on the following optimization flags:
4148 .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
4150 Please note the warning under
4154 on programs that use computed gotos.
4159 turns on all optimizations specified by
4161 and also turns on the
4162 .Fl finline-functions ,
4165 .Fl fgcse-after-reload
4170 This is the default.
4177 optimizations that do not typically increase code size.
4178 It also performs further optimizations designed to reduce code size.
4181 disables the following optimization flags:
4182 .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
4186 options, with or without level numbers, the last such option is the one that is effective.
4191 specify machine-independent flags.
4192 Most flags have both positive and negative forms; the negative form of
4196 In the table below, only one of the forms is listed---the one you typically will use.
4197 You can figure out the other form by either removing
4201 The following options control specific optimizations.
4202 They are either activated by
4204 options or are related to ones that are.
4205 You can use the following flags in the rare cases when "fine-tuning" of optimizations to be performed is desired.
4208 .It Fl fno-default-inline
4209 Do not make member functions inline by default merely because they are defined inside the class scope (C++ only).
4210 Otherwise, when you specify
4212 member functions defined inside class scope are compiled inline by default; i.e., you don't need to add
4214 in front of the member function name.
4216 .It Fl fno-defer-pop
4217 Always pop the arguments to each function call as soon as that function returns.
4218 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.
4227 Force memory operands to be copied into registers before doing arithmetic on them.
4228 This produces better code by making all memory references potential common subexpressions.
4229 When they are not common subexpressions, instruction combination should eliminate the separate register-load.
4230 This option is now a nop and will be removed in 4.2.
4233 Force memory address constants to be copied into registers before doing arithmetic on them.
4235 .It Fl fomit-frame-pointer
4236 Don't keep the frame pointer in a register for functions that don't need one.
4237 This avoids the instructions to save, set up and restore frame pointers; it also makes an extra register available in many functions.
4238 .Sy \&It also makes debugging impossible on some machines.
4240 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.
4241 The machine-description macro
4242 .Va FRAME_POINTER_REQUIRED
4243 controls whether a target machine supports this flag.
4251 .It Fl foptimize-sibling-calls
4252 Optimize sibling and tail recursive calls.
4260 Don't pay attention to the
4263 Normally this option is used to keep the compiler from expanding any functions inline.
4264 Note that if you are not optimizing, no functions can be expanded inline.
4266 .It Fl finline-functions
4267 Integrate all simple functions into their callers.
4268 The compiler heuristically decides which functions are simple enough to be worth integrating in this way.
4270 If all calls to a given function are integrated, and the function is declared
4272 then the function is normally not output as assembler code in its own right.
4277 .It Fl finline-functions-called-once
4280 functions called once for inlining into their caller even if they are not marked
4282 If a call to a given function is integrated, then the function is not output as assembler code in its own right.
4288 .It Fl fearly-inlining
4289 Inline functions marked by
4291 and functions whose body seems smaller than the function call overhead early before doing
4292 .Fl fprofile-generate
4293 instrumentation and real inlining pass.
4294 Doing so makes profiling significantly cheaper and usually inlining faster on programs having large chains of nested wrapper functions.
4298 .It Fl finline-limit= Ns Ar n
4299 By default, GCC limits the size of functions that can be inlined.
4300 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++).
4302 is the size of functions that can be inlined in number of pseudo instructions (not counting parameter handling).
4303 The default value of
4306 Increasing this value can result in more inlined code at the cost of compilation time and memory consumption.
4307 Decreasing usually makes the compilation faster and less code will be inlined (which presumably means slower programs).
4308 This option is particularly useful for programs that use inlining heavily such as those based on recursive templates with C++.
4310 Inlining is actually controlled by a number of parameters, which may be specified individually by using
4311 .Fl -param Ar name Ns = Ns Ar value .
4313 .Fl finline-limit= Ns Ar n
4314 option sets some of these parameters as follows:
4317 .It Sy max-inline-insns-single Ns
4322 .It Sy max-inline-insns-auto Ns
4327 .It Sy min-inline-insns Ns
4330 /4, whichever is smaller.
4332 .It Sy max-inline-insns-rtl Ns
4337 See below for a documentation of the individual parameters controlling inlining.
4340 pseudo instruction represents, in this particular context, an abstract measurement of function's size.
4341 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.
4343 .It Fl fkeep-inline-functions
4346 functions that are declared
4348 into the object file, even if the function has been inlined into all of its callers.
4349 This switch does not affect functions using the
4352 In C++, emit any and all inline functions into the object file.
4354 .It Fl fkeep-static-consts
4355 Emit variables declared
4357 when optimization isn't turned on, even if the variables aren't referenced.
4359 GCC enables this option by default.
4360 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
4361 .Fl fno-keep-static-consts
4364 .It Fl fmerge-constants
4365 Attempt to merge identical constants (string constants and floating point constants) across compilation units.
4367 This option is the default for optimized compilation if the assembler and linker support it.
4369 .Fl fno-merge-constants
4370 to inhibit this behavior.
4378 .It Fl fmerge-all-constants
4379 Attempt to merge identical constants and identical variables.
4382 .Fl fmerge-constants .
4384 .Fl fmerge-constants
4385 this considers e.g. even constant initialized arrays or initialized constant variables with integral or floating point types.
4386 Languages like C or C++ require each non-automatic variable to have distinct location, so using this option will result in non-conforming behavior.
4388 .It Fl fmodulo-sched
4389 Perform swing modulo scheduling immediately before the first scheduling pass.
4390 This pass looks at innermost loops and reorders their instructions by overlapping different iterations.
4392 .It Fl fno-branch-count-reg
4393 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.
4394 This option is only meaningful on architectures that support such instructions, which include x86, PowerPC, IA-64 and S/390.
4397 .Fl fbranch-count-reg ,
4399 .Fl fstrength-reduce
4402 .It Fl fno-function-cse
4403 Do not put function addresses in registers; make each instruction that calls a constant function contain the function's address explicitly.
4405 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.
4410 .It Fl fno-zero-initialized-in-bss
4411 If the target supports a BSS section, GCC by default puts variables that are initialized to zero into BSS.
4412 This can save space in the resulting code.
4414 This option turns off this behavior because some programs explicitly rely on variables going to the data section.
4415 E.g., so that the resulting executable can find the beginning of that section and/or make assumptions based on that.
4418 .Fl fzero-initialized-in-bss .
4420 .It Fl fmudflap Fl fmudflapth Fl fmudflapir
4421 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.
4422 Modules so instrumented should be immune to buffer overflows, invalid heap use, and some other classes of C/C++ programming errors.
4423 The instrumentation relies on a separate runtime library
4424 .Pa ( libmudflap ) ,
4425 which will be linked into a program if
4427 is given at link time.
4428 Run-time behavior of the instrumented program is controlled by the
4430 environment variable.
4432 .Va env MUDFLAP_OPTIONS=-help a.out
4439 to compile and to link if your program is multi-threaded.
4446 if instrumentation should ignore pointer reads.
4447 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.
4449 .It Fl fstrength-reduce
4450 Perform the optimizations of loop strength reduction and elimination of iteration variables.
4457 .It Fl fthread-jumps
4458 Perform optimizations where we check to see if a jump branches to a location where another comparison subsumed by the first is found.
4459 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.
4466 .It Fl fcse-follow-jumps
4467 In common subexpression elimination, scan through jump instructions when the target of the jump is not reached by any other path.
4468 For example, when CSE encounters an
4472 clause, CSE will follow the jump when the condition tested is false.
4479 .It Fl fcse-skip-blocks
4481 .Fl fcse-follow-jumps ,
4482 but causes CSE to follow jumps which conditionally skip over blocks.
4483 When CSE encounters a simple
4485 statement with no else clause,
4486 .Fl fcse-skip-blocks
4487 causes CSE to follow the jump around the body of the
4495 .It Fl frerun-cse-after-loop
4496 Re-run common subexpression elimination after loop optimizations has been performed.
4503 .It Fl frerun-loop-opt
4504 Run the loop optimizer twice.
4512 Perform a global common subexpression elimination pass.
4513 This pass also performs global constant and copy propagation.
4516 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
4518 to the command line.
4528 is enabled, global common subexpression elimination will attempt to move loads which are only killed by stores into themselves.
4529 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.
4531 Enabled by default when gcse is enabled.
4536 is enabled, a store motion pass is run after global common subexpression elimination.
4537 This pass will attempt to move stores out of loops.
4538 When used in conjunction with
4540 loops containing a load/store sequence can be changed to a load before the loop and a store after the loop.
4542 Not enabled at any optimization level.
4547 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).
4549 Not enabled at any optimization level.
4551 .It Fl fgcse-after-reload
4553 .Fl fgcse-after-reload
4554 is enabled, a redundant load elimination pass is performed after reload.
4555 The purpose of this pass is to cleanup redundant spilling.
4557 .It Fl floop-optimize
4558 Perform loop optimizations: move constant expressions out of loops, simplify exit test conditions and optionally do strength-reduction as well.
4566 .It Fl floop-optimize2
4567 Perform loop optimizations using the new loop optimizer.
4568 The optimizations (loop unrolling, peeling and unswitching, loop invariant motion) are enabled by separate flags.
4570 .It Fl funsafe-loop-optimizations
4571 If given, the loop optimizer will assume that loop indices do not overflow, and that the loops with nontrivial exit condition are not infinite.
4572 This enables a wider range of loop optimizations even if the loop optimizer itself cannot prove that these assumptions are valid.
4574 .Fl Wunsafe-loop-optimizations ,
4575 the compiler will warn you if it finds this kind of loop.
4577 .It Fl fcrossjumping
4578 Perform cross-jumping transformation.
4579 This transformation unifies equivalent code and save code size.
4580 The resulting code may or may not perform better than without cross-jumping.
4587 .It Fl fif-conversion
4588 Attempt to transform conditional jumps into branch-less equivalents.
4589 This include use of conditional moves, min, max, set flags and abs instructions, and some tricks doable by standard arithmetics.
4590 The use of conditional execution on chips where it is available is controlled by
4591 .Va if-conversion2 .
4599 .It Fl fif-conversion2
4600 Use conditional execution (where available) to transform conditional jumps into branch-less equivalents.
4608 .It Fl fdelete-null-pointer-checks
4609 Use global dataflow analysis to identify and eliminate useless checks for null pointers.
4610 The compiler assumes that dereferencing a null pointer would have halted the program.
4611 If a pointer is checked after it has already been dereferenced, it cannot be null.
4613 In some environments, this assumption is not true, and programs can safely dereference null pointers.
4615 .Fl fno-delete-null-pointer-checks
4616 to disable this optimization for programs which depend on that behavior.
4623 .It Fl fexpensive-optimizations
4624 Perform a number of minor optimizations that are relatively expensive.
4631 .It Fl foptimize-register-move
4633 Attempt to reassign register numbers in move instructions and as operands of other simple instructions in order to maximize the amount of register tying.
4634 This is especially helpful on machines with two-operand instructions.
4639 .Fl foptimize-register-move
4640 are the same optimization.
4647 .It Fl fdelayed-branch
4648 If supported for the target machine, attempt to reorder instructions to exploit instruction slots available after delayed branch instructions.
4656 .It Fl fschedule-insns
4657 If supported for the target machine, attempt to reorder instructions to eliminate execution stalls due to required data being unavailable.
4658 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.
4665 .It Fl fschedule-insns2
4667 .Fl fschedule-insns ,
4668 but requests an additional pass of instruction scheduling after register allocation has been done.
4669 This is especially useful on machines with a relatively small number of registers and where memory load instructions take more than one cycle.
4676 .It Fl fno-sched-interblock
4677 Don't schedule instructions across basic blocks.
4678 This is normally enabled by default when scheduling before register allocation, i.e.
4685 .It Fl fno-sched-spec
4686 Don't allow speculative motion of non-load instructions.
4687 This is normally enabled by default when scheduling before register allocation, i.e.
4694 .It Fl fsched-spec-load
4695 Allow speculative motion of some load instructions.
4696 This only makes sense when scheduling before register allocation, i.e. with
4702 .It Fl fsched-spec-load-dangerous
4703 Allow speculative motion of more load instructions.
4704 This only makes sense when scheduling before register allocation, i.e. with
4710 .It Fl fsched-stalled-insns
4711 .It Fl fsched-stalled-insns= Ns Ar n
4712 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.
4713 .Fl fno-fsched-stalled-insns
4715 .Fl fsched-stalled-insns=0
4716 are equivalent and mean that no insns will be moved prematurely.
4719 is unspecified then there is no limit on how many queued insns can be moved prematurely.
4721 .It Fl fsched-stalled-insns-dep
4722 .It Fl fsched-stalled-insns-dep= Ns Ar n
4723 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.
4724 This has an effect only during the second scheduling pass, and only if
4725 .Fl fsched-stalled-insns
4726 is used and its value is not zero.
4728 .Fl fno-sched-stalled-insns-dep
4730 .Fl fsched-stalled-insns-dep=0 .
4732 .Fl fsched-stalled-insns-dep
4733 without a value is equivalent to +
4734 .Fl fsched-stalled-insns-dep=1 .
4736 .It Fl fsched2-use-superblocks
4737 When scheduling after register allocation, do use superblock scheduling algorithm.
4738 Superblock scheduling allows motion across basic block boundaries resulting on faster schedules.
4739 This option is experimental, as not all machine descriptions used by GCC model the CPU closely enough to avoid unreliable results from the algorithm.
4741 This only makes sense when scheduling after register allocation, i.e. with
4742 .Fl fschedule-insns2
4747 .It Fl fsched2-use-traces
4749 .Fl fsched2-use-superblocks
4750 algorithm when scheduling after register allocation and additionally perform code duplication in order to increase the size of superblocks using tracer pass.
4753 for details on trace formation.
4755 This mode should produce faster but significantly longer programs.
4757 .Fl fbranch-probabilities
4758 the traces constructed may not match the reality and hurt the performance.
4759 This only makes sense when scheduling after register allocation, i.e. with
4760 .Fl fschedule-insns2
4765 .It Fl freschedule-modulo-scheduled-loops
4766 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.
4768 .It Fl fcaller-saves
4769 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.
4770 Such allocation is done only when it seems to result in better code than would otherwise be produced.
4772 This option is always enabled by default on certain machines, usually those which have no call-preserved registers to use instead.
4780 Perform Partial Redundancy Elimination (PRE) on trees.
4781 This flag is enabled by default at
4787 Perform Full Redundancy Elimination (FRE) on trees.
4788 The difference between FRE and PRE is that FRE only considers expressions that are computed on all paths leading to the redundant computation.
4789 This analysis faster than PRE, though it exposes fewer redundancies.
4790 This flag is enabled by default at
4794 .It Fl ftree-copy-prop
4795 Perform copy propagation on trees.
4796 This pass eliminates unnecessary copy operations.
4797 This flag is enabled by default at
4801 .It Fl ftree-store-copy-prop
4802 Perform copy propagation of memory loads and stores.
4803 This pass eliminates unnecessary copy operations in memory references (structures, global variables, arrays, etc).
4804 This flag is enabled by default at
4809 Perform structural alias analysis on trees.
4810 This flag is enabled by default at
4815 Perform forward store motion on trees.
4816 This flag is enabled by default at
4821 Perform sparse conditional constant propagation (CCP) on trees.
4822 This pass only operates on local scalar variables and is enabled by default at
4826 .It Fl ftree-store-ccp
4827 Perform sparse conditional constant propagation (CCP) on trees.
4828 This pass operates on both local scalar variables and memory stores and loads (global variables, structures, arrays, etc).
4829 This flag is enabled by default at
4834 Perform dead code elimination (DCE) on trees.
4835 This flag is enabled by default at
4839 .It Fl ftree-dominator-opts
4840 Perform a variety of simple scalar cleanups (constant/copy propagation, redundancy elimination, range propagation and expression simplification) based on a dominator tree traversal.
4841 This also performs jump threading (to reduce jumps to jumps).
4842 This flag is enabled by default at
4847 Perform loop header copying on trees.
4848 This is beneficial since it increases effectiveness of code motion optimizations.
4849 It also saves one jump.
4850 This flag is enabled by default at
4853 It is not enabled for
4855 since it usually increases code size.
4857 .It Fl ftree-loop-optimize
4858 Perform loop optimizations on trees.
4859 This flag is enabled by default at
4863 .It Fl ftree-loop-linear
4864 Perform linear loop transformations on tree.
4865 This flag can improve cache performance and allow further loop optimizations to take place.
4867 .It Fl ftree-loop-im
4868 Perform loop invariant motion on trees.
4869 This pass moves only invariants that would be hard to handle at RTL level (function calls, operations that expand to nontrivial sequences of insns).
4872 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.
4873 The pass also includes store motion.
4875 .It Fl ftree-loop-ivcanon
4876 Create a canonical counter for number of iterations in the loop for that determining number of iterations requires complicated analysis.
4877 Later optimizations then may determine the number easily.
4878 Useful especially in connection with unrolling.
4881 Perform induction variable optimizations (strength reduction, induction variable merging and induction variable elimination) on trees.
4884 Perform scalar replacement of aggregates.
4885 This pass replaces structure references with scalars to prevent committing structures to memory too early.
4886 This flag is enabled by default at
4890 .It Fl ftree-copyrename
4891 Perform copy renaming on trees.
4892 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.
4893 This flag is enabled by default at
4898 Perform temporary expression replacement during the SSA-\*[Gt]normal phase.
4899 Single use/single def temporaries are replaced at their use location with their defining expression.
4900 This results in non-GIMPLE code, but gives the expanders much more complex trees to work on resulting in better RTL generation.
4901 This is enabled by default at
4906 Perform live range splitting during the SSA-\*[Gt]normal phase.
4907 Distinct live ranges of a variable are split into unique variables, allowing for better optimization later.
4908 This is enabled by default at
4912 .It Fl ftree-vectorize
4913 Perform loop vectorization on trees.
4915 .It Fl ftree-vect-loop-version
4916 Perform loop versioning when doing loop vectorization on trees.
4917 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.
4918 This option is enabled by default except at level
4920 where it is disabled.
4923 Perform Value Range Propagation on trees.
4924 This is similar to the constant propagation pass, but instead of values, ranges of values are propagated.
4925 This allows the optimizers to remove unnecessary range checks like array bound checks and null pointer checks.
4926 This is enabled by default at
4929 Null pointer check elimination is only done if
4930 .Fl fdelete-null-pointer-checks
4934 Perform tail duplication to enlarge superblock size.
4935 This transformation simplifies the control flow of the function allowing other optimizations to do better job.
4937 .It Fl funroll-loops
4938 Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop.
4941 .Fl fstrength-reduce
4943 .Fl frerun-cse-after-loop .
4944 This option makes code larger, and may or may not make it run faster.
4946 .It Fl funroll-all-loops
4947 Unroll all loops, even if their number of iterations is uncertain when the loop is entered.
4948 This usually makes programs run more slowly.
4949 .Fl funroll-all-loops
4950 implies the same options as
4953 .It Fl fsplit-ivs-in-unroller
4954 Enables expressing of values of induction variables in later iterations of the unrolled loop using the value in the first iteration.
4955 This breaks long dependency chains, thus improving efficiency of the scheduling passes.
4959 and CSE is often sufficient to obtain the same effect.
4960 However in cases the loop body is more complicated than a single basic block, this is not reliable.
4961 It also does not work at all on some of the architectures due to restrictions in the CSE pass.
4963 This optimization is enabled by default.
4965 .It Fl fvariable-expansion-in-unroller
4966 With this option, the compiler will create multiple copies of some local variables when unrolling a loop which can result in superior code.
4968 .It Fl fprefetch-loop-arrays
4969 If supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that access large arrays.
4971 These options may generate better or worse code; results are highly dependent on the structure of loops within the source code.
4974 .It Fl fno-peephole2
4975 Disable any machine-specific peephole optimizations.
4976 The difference between
4980 is in how they are implemented in the compiler; some targets use one, some use the other, a few use both.
4983 is enabled by default.
4990 .It Fl fno-guess-branch-probability
4991 Do not guess branch probabilities using heuristics.
4993 GCC will use heuristics to guess branch probabilities if they are not provided by profiling feedback
4994 .Fl ( fprofile-arcs ) .
4995 These heuristics are based on the control flow graph.
4996 If some branch probabilities are specified by
4997 .Sy __builtin_expect ,
4998 then the heuristics will be used to guess branch probabilities for the rest of the control flow graph, taking the
4999 .Sy __builtin_expect
5001 The interactions between the heuristics and
5002 .Sy __builtin_expect
5003 can be complex, and in some cases, it may be useful to disable the heuristics so that the effects of
5004 .Sy __builtin_expect
5005 are easier to understand.
5008 .Fl fguess-branch-probability
5015 .It Fl freorder-blocks
5016 Reorder basic blocks in the compiled function in order to reduce number of taken branches and improve code locality.
5022 .It Fl freorder-blocks-and-partition
5023 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.
5025 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.
5027 .It Fl freorder-functions
5028 Reorder functions in the object file in order to improve code locality.
5029 This is implemented by using special subsections
5031 for most frequently executed functions and
5033 for unlikely executed functions.
5034 Reordering is done by the linker so object file format must support named sections and linker must place them in a reasonable way.
5036 Also profile feedback must be available in to make this option effective.
5046 .It Fl fstrict-aliasing
5047 Allows the compiler to assume the strictest aliasing rules applicable to the language being compiled.
5048 For C (and C++), this activates optimizations based on the type of expressions.
5049 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.
5058 A character type may alias any other type.
5060 Pay special attention to code like this:
5062 .Bd -literal -offset indent
5074 The practice of reading from a different union member than the one most recently written to (called "type-punning") is common.
5076 .Fl fstrict-aliasing ,
5077 type-punning is allowed, provided the memory is accessed through the union type.
5078 So, the code above will work as expected.
5079 However, this code might not:
5081 .Bd -literal -offset indent
5090 Every language that wishes to perform language-specific alias analysis should define a function that computes, given an
5092 node, an alias set for the node.
5093 Nodes in different alias sets are not allowed to alias.
5094 For an example, see the C front-end function
5095 .Va c_get_alias_set .
5102 .It Fl falign-functions
5103 .It Fl falign-functions= Ns Ar n
5104 Align the start of functions to the next power-of-two greater than
5110 .Fl falign-functions=32
5111 aligns functions to the next 32-byte boundary, but
5112 .Fl falign-functions=24
5113 would align to the next 32-byte boundary only if this can be done by skipping 23 bytes or less.
5115 .Fl fno-align-functions
5117 .Fl falign-functions=1
5118 are equivalent and mean that functions will not be aligned.
5120 Some assemblers only support this flag when
5122 is a power of two; in that case, it is rounded up.
5126 is not specified or is zero, use a machine-dependent default.
5132 .It Fl falign-labels
5133 .It Fl falign-labels= Ns Ar n
5134 Align all branch targets to a power-of-two boundary, skipping up to
5137 .Fl falign-functions .
5138 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.
5140 .Fl fno-align-labels
5143 are equivalent and mean that labels will not be aligned.
5149 are applicable and are greater than this value, then their values are used instead.
5153 is not specified or is zero, use a machine-dependent default which is very likely to be
5155 meaning no alignment.
5162 .It Fl falign-loops= Ns Ar n
5163 Align loops to a power-of-two boundary, skipping up to
5166 .Fl falign-functions .
5167 The hope is that the loop will be executed many times, which will make up for any execution of the dummy operations.
5172 are equivalent and mean that loops will not be aligned.
5176 is not specified or is zero, use a machine-dependent default.
5183 .It Fl falign-jumps= Ns Ar n
5184 Align branch targets to a power-of-two boundary, for branch targets where the targets can only be reached by jumping, skipping up to
5187 .Fl falign-functions .
5188 In this case, no dummy operations need be executed.
5193 are equivalent and mean that loops will not be aligned.
5197 is not specified or is zero, use a machine-dependent default.
5203 .It Fl funit-at-a-time
5204 Parse the whole compilation unit before starting to produce code.
5205 This allows some extra optimizations to take place but consumes more memory (in general).
5206 There are some compatibility issues with
5214 mode may change the order in which functions, variables, and top-level
5216 statements are emitted, and will likely break code relying on some particular ordering.
5217 The majority of such top-level
5219 statements, though, can be replaced by
5225 mode removes unreferenced static variables and functions.
5226 This may result in undefined references when an
5228 statement refers directly to variables or functions that are otherwise unused.
5229 In that case either the variable/function shall be listed as an operand of the
5231 statement operand or, in the case of top-level
5233 statements the attribute
5235 shall be used on the declaration.
5238 Static functions now can use non-standard passing conventions that may break
5240 statements calling functions directly.
5243 will prevent this behavior.
5246 As a temporary workaround,
5247 .Fl fno-unit-at-a-time
5248 can be used, but this scheme may not be supported by future releases of GCC.
5257 Constructs webs as commonly used for register allocation purposes and assign each web individual pseudo register.
5258 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.
5259 It can, however, make debugging impossible, since variables will no longer stay in a "home register".
5261 Enabled by default with
5264 .It Fl fwhole-program
5265 Assume that the current compilation unit represents whole program being compiled.
5266 All public functions and variables with the exception of
5268 and those merged by attribute
5269 .Va externally_visible
5270 become static functions and in a affect gets more aggressively optimized by interprocedural optimizers.
5271 While this option is equivalent to proper use of
5273 keyword for programs consisting of single file, in combination with option
5275 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.
5277 .It Fl fcprop-registers
5278 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.
5286 .It Fl fprofile-generate
5287 Enable options usually used for instrumenting application to produce profile useful for later recompilation with profile feedback based optimization.
5289 .Fl fprofile-generate
5290 both when compiling and when linking your program.
5292 The following options are enabled:
5293 .Va -fprofile-arcs ,
5294 .Va -fprofile-values ,
5298 Enable profile feedback directed optimizations, and optimizations generally profitable only with profile feedback available.
5300 The following options are enabled:
5301 .Va -fbranch-probabilities ,
5303 .Va -funroll-loops ,
5306 .Va -fno-loop-optimize .
5309 The following options control compiler behavior regarding floating point arithmetic.
5310 These options trade off between speed and correctness.
5311 All must be specifically enabled.
5315 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.
5317 This option prevents undesirable excess precision on machines such as the 68000 where the floating registers (of the 68881) keep more precision than a
5319 is supposed to have.
5320 Similarly for the x86 architecture.
5321 For most programs, the excess precision does only good, but a few programs rely on the precise definition of IEEE floating point.
5324 for such programs, after modifying them to store all pertinent intermediate computations into variables.
5328 .Fl fno-math-errno ,
5329 .Fl funsafe-math-optimizations ,
5330 .Fl fno-trapping-math ,
5331 .Fl ffinite-math-only ,
5332 .Fl fno-rounding-math ,
5333 .Fl fno-signaling-nans
5335 .Sy fcx-limited-range .
5337 This option causes the preprocessor macro
5341 This option should never be turned on by any
5343 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.
5345 .It Fl fno-math-errno
5346 Do not set ERRNO after calling math functions that are executed with a single instruction, e.g., sqrt.
5347 A program that relies on IEEE exceptions for math error handling may want to use this flag for speed while maintaining IEEE arithmetic compatibility.
5349 This option should never be turned on by any
5351 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.
5356 On Darwin systems, the math library never sets
5358 There is therefore no reason for the compiler to consider the possibility that it might, and
5362 .It Fl funsafe-math-optimizations
5363 Allow optimizations for floating-point arithmetic that (a) assume that arguments and results are valid and (b) may violate IEEE or ANSI standards.
5364 When used at link-time, it may include libraries or startup files that change the default FPU control word or other similar optimizations.
5366 This option should never be turned on by any
5368 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.
5371 .Fl fno-unsafe-math-optimizations .
5373 .It Fl ffinite-math-only
5374 Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs.
5376 This option should never be turned on by any
5378 option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications.
5381 .Fl fno-finite-math-only .
5383 .It Fl fno-trapping-math
5384 Compile code assuming that floating-point operations cannot generate user-visible traps.
5385 These traps include division by zero, overflow, underflow, inexact result and invalid operation.
5387 .Fl fno-signaling-nans .
5388 Setting this option may allow faster code if one relies on "non-stop" IEEE arithmetic, for example.
5390 This option should never be turned on by any
5392 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.
5395 .Fl ftrapping-math .
5397 .It Fl frounding-math
5398 Disable transformations and optimizations that assume default floating point rounding behavior.
5399 This is round-to-zero for all floating point to integer conversions, and round-to-nearest for all other arithmetic truncations.
5400 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.
5401 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.
5404 .Fl fno-rounding-math .
5406 This option is experimental and does not currently guarantee to disable all GCC optimizations that are affected by rounding mode.
5407 Future versions of GCC may provide finer control of this setting using C99's
5410 This command line option will be used to specify the default state for
5413 .It Fl fsignaling-nans
5414 Compile code assuming that IEEE signaling NaNs may generate user-visible traps during floating-point operations.
5415 Setting this option disables optimizations that may change the number of exceptions visible with signaling NaNs.
5417 .Fl ftrapping-math .
5419 This option causes the preprocessor macro
5420 .Va __SUPPORT_SNAN__
5424 .Fl fno-signaling-nans .
5426 This option is experimental and does not currently guarantee to disable all GCC optimizations that affect signaling NaN behavior.
5428 .It Fl fsingle-precision-constant
5429 Treat floating point constant as single precision constant instead of implicitly converting it to double precision constant.
5431 .It Fl fcx-limited-range
5432 When enabled, this option states that a range reduction step is not needed when performing complex division.
5434 .Fl fno-cx-limited-range ,
5438 This option controls the default setting of the ISO C99
5439 .Va CX_LIMITED_RANGE
5441 Nevertheless, the option applies to all languages.
5444 The following options control optimizations that may improve performance, but are not enabled by any
5447 This section includes experimental options that may produce broken code.
5450 .It Fl fbranch-probabilities
5451 After running a program compiled with
5453 you can compile it a second time using
5454 .Fl fbranch-probabilities ,
5455 to improve optimizations based on the number of times each branch was taken.
5456 When the program compiled with
5458 exits it saves arc execution counts to a file called
5460 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.
5463 .Fl fbranch-probabilities ,
5470 These can be used to improve optimization.
5471 Currently, they are only used in one place: in
5473 instead of guessing which path a branch is mostly to take, the
5475 values are used to exactly determine which path is taken more often.
5477 .It Fl fprofile-values
5480 it adds code so that some data about values of expressions in the program is gathered.
5483 .Fl fbranch-probabilities ,
5484 it reads back the data gathered from profiling values of expressions and adds
5485 .Sy REG_VALUE_PROFILE
5486 notes to instructions for their later usage in optimizations.
5489 .Fl fprofile-generate
5496 it instructs the compiler to add a code to gather information about values of expressions.
5499 .Fl fbranch-probabilities ,
5500 it reads back the data gathered and actually performs the optimizations based on them.
5501 Currently the optimizations include specialization of division operation using the knowledge about the value of the denominator.
5503 .It Fl frename-registers
5504 Attempt to avoid false dependencies in scheduled code by making use of registers left over after register allocation.
5505 This optimization will most benefit processors with lots of registers.
5506 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".
5508 Enabled by default with
5512 Perform tail duplication to enlarge superblock size.
5513 This transformation simplifies the control flow of the function allowing other optimizations to do better job.
5518 .It Fl funroll-loops
5519 Unroll loops whose number of iterations can be determined at compile time or upon entry to the loop.
5522 .Fl frerun-cse-after-loop ,
5525 .Fl frename-registers .
5526 It also turns on complete loop peeling (i.e. complete removal of loops with small constant number of iterations).
5527 This option makes code larger, and may or may not make it run faster.
5532 .It Fl funroll-all-loops
5533 Unroll all loops, even if their number of iterations is uncertain when the loop is entered.
5534 This usually makes programs run more slowly.
5535 .Fl funroll-all-loops
5536 implies the same options as
5540 Peels the loops for that there is enough information that they do not roll much (from profile feedback).
5541 It also turns on complete loop peeling (i.e. complete removal of loops with small constant number of iterations).
5546 .It Fl fmove-loop-invariants
5547 Enables the loop invariant motion pass in the new loop optimizer.
5551 .It Fl funswitch-loops
5552 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).
5554 .It Fl fprefetch-loop-arrays
5555 If supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that access large arrays.
5560 .It Fl ffunction-sections
5561 .It Fl fdata-sections
5562 Place each function or data item into its own section in the output file if the target supports arbitrary sections.
5563 The name of the function or the name of the data item determines the section's name in the output file.
5565 Use these options on systems where the linker can perform optimizations to improve locality of reference in the instruction space.
5566 Most systems using the ELF object format and SPARC processors running Solaris 2 have linkers with such optimizations.
5567 AIX may have these optimizations in the future.
5569 Only use these options when there are significant benefits from doing so.
5570 When you specify these options, the assembler and linker will create larger object and executable files and will also be slower.
5571 You will not be able to use
5573 on all systems if you specify this option and you may have problems with debugging if you specify both this option and
5576 .It Fl fbranch-target-load-optimize
5577 Perform branch target register load optimization before prologue / epilogue threading.
5578 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.
5580 .It Fl fbranch-target-load-optimize2
5581 Perform branch target register load optimization after prologue / epilogue threading.
5583 .It Fl fbtr-bb-exclusive
5584 When performing branch target register load optimization, don't reuse branch target registers in within any basic block.
5586 .It Fl fstack-protector
5587 Emit extra code to check for buffer overflows, such as stack smashing attacks.
5588 This is done by adding a guard variable to functions with vulnerable objects.
5589 This includes functions that call alloca, and functions with buffers larger than 8 bytes.
5590 The guards are initialized when a function is entered and then checked when the function exits.
5591 If a guard check fails, an error message is printed and the program exits.
5593 .It Fl fstack-protector-all
5595 .Fl fstack-protector
5596 except that all functions are protected.
5598 .It Fl -param Ar name Ns = Ns Ar value
5599 In some places, GCC uses various constants to control the amount of optimization that is done.
5600 For example, GCC will not inline functions that contain more that a certain number of instructions.
5601 You can control some of these constants on the command-line using the
5605 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.
5610 The allowable choices for
5612 are given in the following table:
5615 .It Sy salias-max-implicit-fields Ns
5616 The maximum number of fields in a variable without direct structure accesses for which structure aliasing will consider trying to track each field.
5619 .It Sy sra-max-structure-size Ns
5620 The maximum structure size, in bytes, at which the scalar replacement of aggregates (SRA) optimization will perform block copies.
5621 The default value, 0, implies that GCC will select the most appropriate size itself.
5623 .It Sy sra-field-structure-ratio Ns
5624 The threshold ratio (as a percentage) between instantiated fields and the complete structure size.
5625 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.
5628 .It Sy max-crossjump-edges Ns
5629 The maximum number of incoming edges to consider for crossjumping.
5630 The algorithm used by
5632 is O(N^2) in the number of edges incoming to each block.
5633 Increasing values mean more aggressive optimization, making the compile time increase with probably small improvement in executable size.
5635 .It Sy min-crossjump-insns Ns
5636 The minimum number of instructions which must be matched at the end of two blocks before crossjumping will be performed on them.
5637 This value is ignored in the case where all instructions in the block being crossjumped from are matched.
5638 The default value is 5.
5640 .It Sy max-grow-copy-bb-insns Ns
5641 The maximum code size expansion factor when copying basic blocks instead of jumping.
5642 The expansion is relative to a jump instruction.
5643 The default value is 8.
5645 .It Sy max-goto-duplication-insns Ns
5646 The maximum number of instructions to duplicate to a block that jumps to a computed goto.
5647 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.
5648 Only computed jumps at the end of a basic blocks with no more than max-goto-duplication-insns are unfactored.
5649 The default value is 8.
5651 .It Sy max-delay-slot-insn-search Ns
5652 The maximum number of instructions to consider when looking for an instruction to fill a delay slot.
5653 If more than this arbitrary number of instructions is searched, the time savings from filling the delay slot will be minimal so stop searching.
5654 Increasing values mean more aggressive optimization, making the compile time increase with probably small improvement in executable run time.
5656 .It Sy max-delay-slot-live-search Ns
5657 When trying to fill delay slots, the maximum number of instructions to consider when searching for a block with valid live register information.
5658 Increasing this arbitrarily chosen value means more aggressive optimization, increasing the compile time.
5659 This parameter should be removed when the delay slot code is rewritten to maintain the control-flow graph.
5661 .It Sy max-gcse-memory Ns
5662 The approximate maximum amount of memory that will be allocated in order to perform the global common subexpression elimination optimization.
5663 If more memory than specified is required, the optimization will not be done.
5665 .It Sy max-gcse-passes Ns
5666 The maximum number of passes of GCSE to run.
5669 .It Sy max-pending-list-length Ns
5670 The maximum number of pending dependencies scheduling will allow before flushing the current state and starting over.
5671 Large functions with few branches or calls can create excessively large lists which needlessly consume memory and resources.
5673 .It Sy max-inline-insns-single Ns
5674 Several parameters control the tree inliner used in gcc.
5675 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.
5676 This only affects functions declared inline and methods implemented in a class declaration (C++).
5677 The default value is 450.
5679 .It Sy max-inline-insns-auto Ns
5681 .Fl finline-functions
5684 a lot of functions that would otherwise not be considered for inlining by the compiler will be investigated.
5685 To those functions, a different (more restrictive) limit compared to functions declared inline can be applied.
5686 The default value is 90.
5688 .It Sy large-function-insns Ns
5689 The limit specifying really large functions.
5690 For functions larger than this limit after inlining inlining is constrained by
5691 .Fl -param Ar large-function-growth .
5692 This parameter is useful primarily to avoid extreme compilation time caused by non-linear algorithms used by the backend.
5693 This parameter is ignored when
5696 The default value is 2700.
5698 .It Sy large-function-growth Ns
5699 Specifies maximal growth of large function caused by inlining in percents.
5700 This parameter is ignored when
5703 The default value is 100 which limits large function growth to 2.0 times the original size.
5705 .It Sy large-unit-insns Ns
5706 The limit specifying large translation unit.
5707 Growth caused by inlining of units larger than this limit is limited by
5708 .Fl -param Ar inline-unit-growth .
5709 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.
5710 If B is small relative to A, the growth of unit is 300% and yet such inlining is very sane.
5711 For very large units consisting of small inlininable functions however the overall unit growth limit is needed to avoid exponential explosion of code size.
5712 Thus for smaller units, the size is increased to
5713 .Fl -param Ar large-unit-insns
5715 .Fl -param Ar inline-unit-growth .
5716 The default is 10000
5718 .It Sy inline-unit-growth Ns
5719 Specifies maximal overall growth of the compilation unit caused by inlining.
5720 This parameter is ignored when
5723 The default value is 50 which limits unit growth to 1.5 times the original size.
5725 .It Sy max-inline-insns-recursive Ns
5726 .It Sy max-inline-insns-recursive-auto Ns
5727 Specifies maximum number of instructions out-of-line copy of self recursive inline function can grow into by performing recursive inlining.
5729 For functions declared inline
5730 .Fl -param Ar max-inline-insns-recursive
5731 is taken into account.
5732 For function not declared inline, recursive inlining happens only when
5733 .Fl finline-functions
5737 .Fl -param Ar max-inline-insns-recursive-auto
5739 The default value is 450.
5741 .It Sy max-inline-recursive-depth Ns
5742 .It Sy max-inline-recursive-depth-auto Ns
5743 Specifies maximum recursion depth used by the recursive inlining.
5745 For functions declared inline
5746 .Fl -param Ar max-inline-recursive-depth
5747 is taken into account.
5748 For function not declared inline, recursive inlining happens only when
5749 .Fl finline-functions
5753 .Fl -param Ar max-inline-recursive-depth-auto
5755 The default value is 450.
5757 .It Sy min-inline-recursive-probability Ns
5758 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.
5760 When profile feedback is available (see
5761 .Fl fprofile-generate )
5762 the actual recursion depth can be guessed from probability that function will recurse via given call expression.
5763 This parameter limits inlining only to call expression whose probability exceeds given threshold (in percents).
5764 The default value is 10.
5766 .It Sy inline-call-cost Ns
5767 Specify cost of call instruction relative to simple arithmetics operations (having cost of 1).
5768 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.
5769 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.
5770 The default value is 16.
5772 .It Sy max-unrolled-insns Ns
5773 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.
5775 .It Sy max-average-unrolled-insns Ns
5776 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.
5778 .It Sy max-unroll-times Ns
5779 The maximum number of unrollings of a single loop.
5781 .It Sy max-peeled-insns Ns
5782 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.
5784 .It Sy max-peel-times Ns
5785 The maximum number of peelings of a single loop.
5787 .It Sy max-completely-peeled-insns Ns
5788 The maximum number of insns of a completely peeled loop.
5790 .It Sy max-completely-peel-times Ns
5791 The maximum number of iterations of a loop to be suitable for complete peeling.
5793 .It Sy max-unswitch-insns Ns
5794 The maximum number of insns of an unswitched loop.
5796 .It Sy max-unswitch-level Ns
5797 The maximum number of branches unswitched in a single loop.
5799 .It Sy lim-expensive Ns
5800 The minimum cost of an expensive expression in the loop invariant motion.
5802 .It Sy iv-consider-all-candidates-bound Ns
5803 Bound on number of candidates for induction variables below that all candidates are considered for each use in induction variable optimizations.
5804 Only the most relevant candidates are considered if there are more candidates, to avoid quadratic time complexity.
5806 .It Sy iv-max-considered-uses Ns
5807 The induction variable optimizations give up on loops that contain more induction variable uses.
5809 .It Sy iv-always-prune-cand-set-bound Ns
5810 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.
5812 .It Sy scev-max-expr-size Ns
5813 Bound on size of expressions used in the scalar evolutions analyzer.
5814 Large expressions slow the analyzer.
5816 .It Sy vect-max-version-checks Ns
5817 The maximum number of runtime checks that can be performed when doing loop versioning in the vectorizer.
5818 See option ftree-vect-loop-version for more information.
5820 .It Sy max-iterations-to-track Ns
5821 The maximum number of iterations of a loop the brute force algorithm for analysis of # of iterations of the loop tries to evaluate.
5823 .It Sy hot-bb-count-fraction Ns
5824 Select fraction of the maximal count of repetitions of basic block in program given basic block needs to have to be considered hot.
5826 .It Sy hot-bb-frequency-fraction Ns
5827 Select fraction of the maximal frequency of executions of basic block in function given basic block needs to have to be considered hot
5829 .It Sy max-predicted-iterations Ns
5830 The maximum number of loop iterations we predict statically.
5831 This is useful in cases where function contain single loop with known bound and other loop with unknown.
5832 We predict the known number of iterations correctly, while the unknown number of iterations average to roughly 10.
5833 This means that the loop without bounds would appear artificially cold relative to the other one.
5835 .It Sy tracer-dynamic-coverage Ns
5836 .It Sy tracer-dynamic-coverage-feedback Ns
5837 This value is used to limit superblock formation once the given percentage of executed instructions is covered.
5838 This limits unnecessary code size expansion.
5841 .Sy tracer-dynamic-coverage-feedback
5842 is used only when profile feedback is available.
5843 The real profiles (as opposed to statically estimated ones) are much less balanced allowing the threshold to be larger value.
5845 .It Sy tracer-max-code-growth Ns
5846 Stop tail duplication once code growth has reached given percentage.
5847 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.
5849 .It Sy tracer-min-branch-ratio Ns
5850 Stop reverse growth when the reverse probability of best edge is less than this threshold (in percent).
5852 .It Sy tracer-min-branch-ratio Ns
5853 .It Sy tracer-min-branch-ratio-feedback Ns
5854 Stop forward growth if the best edge do have probability lower than this threshold.
5857 .Sy tracer-dynamic-coverage
5858 two values are present, one for compilation for profile feedback and one for compilation without.
5859 The value for compilation with profile feedback needs to be more conservative (higher) in order to make tracer effective.
5861 .It Sy max-cse-path-length Ns
5862 Maximum number of basic blocks on path that cse considers.
5865 .It Sy max-cse-insns Ns
5866 The maximum instructions CSE process before flushing.
5867 The default is 1000.
5869 .It Sy global-var-threshold Ns
5870 Counts the number of function calls
5872 and the number of call-clobbered variables
5878 is larger than this limit, a single artificial variable will be created to represent all the call-clobbered variables at function call sites.
5879 This artificial variable will then be made to alias every call-clobbered variable.
5882 on the host machine; beware overflow).
5884 .It Sy max-aliased-vops Ns
5885 Maximum number of virtual operands allowed to represent aliases before triggering the alias grouping heuristic.
5886 Alias grouping reduces compile times and memory consumption needed for aliasing at the expense of precision loss in alias information.
5888 .It Sy ggc-min-expand Ns
5889 GCC uses a garbage collector to manage its own memory allocation.
5890 This parameter specifies the minimum percentage by which the garbage collector's heap should be allowed to expand between collections.
5891 Tuning this may improve compilation speed; it has no effect on code generation.
5893 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when RAM \*[Gt]= 1GB.
5896 is available, the notion of "RAM" is the smallest of actual RAM and
5900 If GCC is not able to calculate RAM on a particular platform, the lower bound of 30% is used.
5901 Setting this parameter and
5902 .Sy ggc-min-heapsize
5903 to zero causes a full collection to occur at every opportunity.
5904 This is extremely slow, but can be useful for debugging.
5906 .It Sy ggc-min-heapsize Ns
5907 Minimum size of the garbage collector's heap before it begins bothering to collect garbage.
5908 The first collection occurs after the heap expands by
5911 .Sy ggc-min-heapsize .
5912 Again, tuning this may improve compilation speed, and has no effect on code generation.
5914 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).
5915 If GCC is not able to calculate RAM on a particular platform, the lower bound is used.
5916 Setting this parameter very large effectively disables garbage collection.
5917 Setting this parameter and
5919 to zero causes a full collection to occur at every opportunity.
5921 .It Sy max-reload-search-insns Ns
5922 The maximum number of instruction reload should look backward for equivalent register.
5923 Increasing values mean more aggressive optimization, making the compile time increase with probably slightly better performance.
5924 The default value is 100.
5926 .It Sy max-cselib-memory-location Ns
5927 The maximum number of memory locations cselib should take into account.
5928 Increasing values mean more aggressive optimization, making the compile time increase with probably slightly better performance.
5929 The default value is 500.
5931 .It Sy max-flow-memory-location Ns
5933 .Sy max-cselib-memory-location
5934 but for dataflow liveness.
5935 The default value is 100.
5937 .It Sy reorder-blocks-duplicate Ns
5938 .It Sy reorder-blocks-duplicate-feedback Ns
5939 Used by basic block reordering pass to decide whether to use unconditional branch or duplicate the code on its destination.
5940 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.
5943 .Sy reorder-block-duplicate-feedback
5944 is used only when profile feedback is available and may be set to higher values than
5945 .Sy reorder-block-duplicate
5946 since information about the hot spots is more accurate.
5948 .It Sy max-sched-ready-insns Ns
5949 The maximum number of instructions ready to be issued the scheduler should consider at any given time during the first scheduling pass.
5950 Increasing values mean more thorough searches, making the compilation time increase with probably little benefit.
5951 The default value is 100.
5953 .It Sy max-sched-region-blocks Ns
5954 The maximum number of blocks in a region to be considered for interblock scheduling.
5955 The default value is 10.
5957 .It Sy max-sched-region-insns Ns
5958 The maximum number of insns in a region to be considered for interblock scheduling.
5959 The default value is 100.
5961 .It Sy min-sched-prob Ns
5962 The minimum probability of reaching a source block for interblock speculative scheduling.
5963 The default value is 40.
5965 .It Sy max-last-value-rtl Ns
5966 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.
5967 The default is 10000.
5969 .It Sy integer-share-limit Ns
5970 Small integer constants can use a shared data structure, reducing the compiler's memory usage and increasing its speed.
5971 This sets the maximum value of a shared integer constant's.
5972 The default value is 256.
5974 .It Sy min-virtual-mappings Ns
5975 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.
5976 The default value is 100.
5978 .It Sy virtual-mappings-ratio Ns
5979 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.
5980 The default ratio is 3.
5982 .It Sy ssp-buffer-size Ns
5983 The minimum size of buffers (i.e. arrays) that will receive stack smashing protection when
5984 .Fl fstack-protection
5987 .It Sy max-jump-thread-duplication-stmts Ns
5988 Maximum number of statements allowed in a block that needs to be duplicated when threading jumps.
5990 .It Sy max-fields-for-field-sensitive Ns
5991 Maximum number of fields in a structure we will treat in a field sensitive manner during pointer analysis.
5995 .Ss Options Controlling the Preprocessor
5996 These options control the C preprocessor, which is run on each C source file before actual compilation.
6000 option, nothing is done except preprocessing.
6001 Some of these options make sense only together with
6003 because they cause the preprocessor output to be unsuitable for actual compilation.
6006 .It Fl Wp, Ns Ar option
6008 .Fl Wp, Ns Ar option
6009 to bypass the compiler driver and pass
6011 directly through to the preprocessor.
6014 contains commas, it is split into multiple options at the commas.
6015 However, many options are modified, translated or interpreted by the compiler driver before being passed to the preprocessor, and
6017 forcibly bypasses this phase.
6018 The preprocessor's direct interface is undocumented and subject to change, so whenever possible you should avoid using
6020 and let the driver handle the options instead.
6022 .It Fl Xpreprocessor Ar option
6025 as an option to the preprocessor.
6026 You can use this to supply system-specific preprocessor options which GCC does not know how to recognize.
6028 If you want to pass an option that takes an argument, you must use
6030 twice, once for the option and once for the argument.
6037 as a macro, with definition
6040 .It Fl D Ar name Ns = Ns Ar definition
6043 are tokenized and processed as if they appeared during translation phase three in a
6046 In particular, the definition will be truncated by embedded newline characters.
6048 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.
6050 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).
6051 Parentheses are meaningful to most shells, so you will need to quote the option.
6068 options are processed in the order they are given on the command line.
6073 options are processed after all
6080 Cancel any previous definition of
6082 either built in or provided with a
6087 Do not predefine any system-specific or GCC-specific macros.
6088 The standard predefined macros remain defined.
6093 to the list of directories to be searched for header files.
6094 Directories named by
6096 are searched before the standard system include directories.
6099 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 .
6104 This is the same as specifying
6106 as the second non-option argument to
6109 has a different interpretation of a second non-option argument, so you must use
6111 to specify the output file.
6114 Turns on all optional warnings which are desirable for normal code.
6119 and a warning about integer promotion causing a change of sign in
6122 Note that many of the preprocessor's warnings are on by default and have no options to control them.
6126 Warn whenever a comment-start sequence
6130 comment, or whenever a backslash-newline appears in a
6133 (Both forms have the same effect.)
6136 @anchor{Wtrigraphs} Most trigraphs in comments cannot affect the meaning of the program.
6137 However, a trigraph that would form an escaped newline
6139 at the end of a line) can, by changing where the comment begins or ends.
6140 Therefore, only trigraphs that would form escaped newlines produce warnings inside a comment.
6142 This option is implied by
6146 is not given, this option is still enabled unless trigraphs are enabled.
6147 To get trigraph conversion without warnings, but get the other
6150 .Fl trigraphs Fl Wall Fl Wno-trigraphs .
6153 Warn about certain constructs that behave differently in traditional and ISO C.
6154 Also warn about ISO C constructs that have no traditional C equivalent, and problematic constructs which should be avoided.
6162 Warn whenever an identifier which is not a macro is encountered in an
6164 directive, outside of
6166 Such identifiers are replaced with zero.
6168 .It Fl Wunused-macros
6169 Warn about macros defined in the main file that are unused.
6172 if it is expanded or tested for existence at least once.
6173 The preprocessor will also warn if the macro has not been used at the time it is redefined or undefined.
6175 Built-in macros, macros defined on the command line, and macros defined in include files are not warned about.
6178 If a macro is actually used, but only used in skipped conditional blocks, then CPP will report it as unused.
6179 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.
6180 Alternatively, you could provide a dummy use with something like:
6182 .Bd -literal -offset indent
6183 #if defined the_macro_causing_the_warning
6186 .It Fl Wendif-labels
6191 are followed by text.
6192 This usually happens in code of the form
6194 .Bd -literal -offset indent
6201 The second and third
6203 should be in comments, but often are not in older programs.
6204 This warning is on by default.
6207 Make all warnings into hard errors.
6208 Source code which triggers warnings will be rejected.
6210 .It Fl Wsystem-headers
6211 Issue warnings for code in system headers.
6212 These are normally unhelpful in finding bugs in your own code, therefore suppressed.
6213 If you are responsible for the system library, you may want to see them.
6216 Suppress all warnings, including those which GNU CPP issues by default.
6219 Issue all the mandatory diagnostics listed in the C standard.
6220 Some of them are left out by default, since they trigger frequently on harmless code.
6222 .It Fl pedantic-errors
6223 Issue all the mandatory diagnostics, and make all mandatory diagnostics into errors.
6224 This includes mandatory diagnostics that GCC issues without
6226 but treats as warnings.
6229 Instead of outputting the result of preprocessing, output a rule suitable for
6231 describing the dependencies of the main source file.
6232 The preprocessor outputs one
6234 rule containing the object file name for that source file, a colon, and the names of all the included files, including those coming from
6238 command line options.
6240 Unless specified explicitly (with
6244 the object file name consists of the basename of the source file with any suffix replaced with object file suffix.
6245 If there are many included files then the rule is split into several lines using
6248 The rule has no commands.
6250 This option does not suppress the preprocessor's debug output, such as
6252 To avoid mixing such debug output with the dependency rules you should explicitly specify the dependency output file with
6254 or use an environment variable like
6255 .Sy DEPENDENCIES_OUTPUT .
6256 Debug output will still be sent to the regular output stream as normal.
6260 to the driver implies
6262 and suppresses warnings with an implicit
6268 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.
6270 This implies that the choice of angle brackets or double quotes in an
6272 directive does not in itself determine whether that header will appear in
6275 This is a slight change in semantics from GCC versions 3.0 and earlier.
6284 specifies a file to write the dependencies to.
6287 switch is given the preprocessor sends the rules to the same place it would have sent preprocessed output.
6289 When used with the driver options
6294 overrides the default dependency output file.
6297 In conjunction with an option such as
6299 requesting dependency generation,
6301 assumes missing header files are generated files and adds them to the dependency list without raising an error.
6302 The dependency filename is taken directly from the
6304 directive without prepending any path.
6306 also suppresses preprocessed output, as a missing header file renders this useless.
6308 This feature is used in automatic updating of makefiles.
6311 This option instructs CPP to add a phony target for each dependency other than the main file, causing each to depend on nothing.
6312 These dummy rules work around errors
6314 gives if you remove header files without updating the
6318 This is typical output:
6320 .Bd -literal -offset indent
6321 test.o: test.c test.h
6326 Change the target of the rule emitted by dependency generation.
6327 By default CPP takes the name of the main input file, including any path, deletes any file suffix such as
6329 and appends the platform's usual object suffix.
6330 The result is the target.
6334 option will set the target to be exactly the string you specify.
6335 If you want multiple targets, you can specify them as a single argument to
6342 .Sy -MT '$(objpfx)foo.o'
6345 .Bd -literal -offset indent
6346 $(objpfx)foo.o: foo.c
6351 but it quotes any characters which are special to Make.
6352 .Sy -MQ '$(objpfx)foo.o'
6355 .Bd -literal -offset indent
6356 $$(objpfx)foo.o: foo.c
6358 The default target is automatically quoted, as if it were given with
6364 .Fl M Fl MF Ar file ,
6368 The driver determines
6373 If it is, the driver uses its argument but with a suffix of
6375 otherwise it take the basename of the input file and applies a
6381 is used in conjunction with
6385 switch is understood to specify the dependency output file (but @pxref{dashMF,,-MF}), but if used without
6389 is understood to specify a target object file.
6395 can be used to generate a dependency output file as a side-effect of the compilation process.
6400 except mention only user header files, not system header files.
6403 When using precompiled headers, this flag will cause the dependency-output flags to also list the files from the precompiled header's dependencies.
6404 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.
6406 .It Fl fpch-preprocess
6407 This option allows use of a precompiled header together with
6409 It inserts a special
6411 .Va #pragma GCC pch_preprocess \&"\*[Lt]filename\*[Gt]"
6412 in the output to mark the place where the precompiled header was found, and its filename.
6415 is in use, GCC recognizes this
6419 This option is off by default, because the resulting preprocessed output is only really suitable as input to GCC.
6420 It is switched on by
6423 You should not write this
6425 in your own code, but it is safe to edit the filename if the PCH file is available in a different location.
6426 The filename may be absolute or it may be relative to GCC's current directory.
6430 .It Fl x Ar objective-c
6431 .It Fl x Ar assembler-with-cpp
6432 Specify the source language: C, C++, Objective-C, or assembly.
6433 This has nothing to do with standards conformance or extensions; it merely selects which base syntax to expect.
6434 If you give none of these options, cpp will deduce the language from the extension of the source file:
6440 Some other common extensions for C++ and assembly are also recognized.
6441 If cpp does not recognize the extension, it will treat the file as C; this is the most generic mode.
6444 Previous versions of cpp accepted a
6446 option which selected both the language and the standards conformance level.
6447 This option has been removed, because it conflicts with the
6451 .It Fl std= Ns Ar standard
6453 Specify the standard to which the code should conform.
6454 Currently CPP knows about C and C++ standards; others may be added in the future.
6460 .It Sy iso9899:1990 Ns
6462 The ISO C standard from 1990.
6464 is the customary shorthand for this version of the standard.
6468 option is equivalent to
6471 .It Sy iso9899:199409 Ns
6472 The 1990 C standard, as amended in 1994.
6474 .It Sy iso9899:1999 Ns
6476 .It Sy iso9899:199x Ns
6478 The revised ISO C standard, published in December 1999.
6479 Before publication, this was known as C9X.
6482 The 1990 C standard plus GNU extensions.
6483 This is the default.
6487 The 1999 C standard plus GNU extensions.
6490 The 1998 ISO C++ standard plus amendments.
6495 plus GNU extensions.
6496 This is the default for C++ code.
6500 Split the include path.
6501 Any directories specified with
6505 are searched only for headers requested with
6506 .Va .Sy #include \&"file" ;
6507 they are not searched for
6508 .Va .Sy #include \*[Lt]file\*[Gt] .
6509 If additional directories are specified with
6513 those directories are searched for all
6519 inhibits the use of the directory of the current file directory as the first search directory for
6520 .Va .Sy #include \&"file" .
6521 This option has been deprecated.
6524 Do not search the standard system directories for header files.
6525 Only the directories you have specified with
6527 options (and the directory of the current file, if appropriate) are searched.
6530 Do not search for header files in the C++-specific standard directories, but do still search the other standard directories.
6531 (This option is used when building the C++ library.)
6533 .It Fl include Ar file
6537 .Va #include \&"file"
6538 appeared as the first line of the primary source file.
6539 However, the first directory searched for
6541 is the preprocessor's working directory
6543 the directory containing the main source file.
6544 If not found there, it is searched for in the remainder of the
6545 .Va #include \&"..."
6546 search chain as normal.
6550 options are given, the files are included in the order they appear on the command line.
6552 .It Fl imacros Ar file
6555 except that any output produced by scanning
6558 Macros it defines remain defined.
6559 This allows you to acquire all the macros from a header without also processing its declarations.
6561 All files specified by
6563 are processed before all files specified by
6566 .It Fl idirafter Ar dir
6569 for header files, but do it
6571 all directories specified with
6573 and the standard system directories have been exhausted.
6575 is treated as a system include directory.
6577 .It Fl iprefix Ar prefix
6580 as the prefix for subsequent
6583 If the prefix represents a directory, you should include the final
6586 .It Fl iwithprefix Ar dir
6587 .It Fl iwithprefixbefore Ar dir
6590 to the prefix specified previously with
6592 and add the resulting directory to the include search path.
6593 .Fl iwithprefixbefore
6594 puts it in the same place
6602 .It Fl isysroot Ar dir
6603 This option is like the
6605 option, but applies only to header files.
6608 option for more information.
6610 .It Fl isystem Ar dir
6613 for header files, after all directories specified by
6615 but before the standard system directories.
6616 Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories.
6618 .It Fl cxx-isystem Ar dir
6621 for C++ header files, after all directories specified by
6623 but before the standard system directories.
6624 Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories.
6626 .It Fl iquote Ar dir
6629 only for header files requested with
6630 .Va .Sy #include \&"file" ;
6631 they are not searched for
6632 .Va .Sy #include \*[Lt]file\*[Gt] ,
6633 before all directories specified by
6635 and before the standard system directories.
6637 .It Fl iremap Ns Ar src Ns : Ns Ar dst
6645 This option can be specified more than once.
6646 Processing stops at the first match.
6647 .It Fl fdollars-in-identifiers
6648 @anchor{fdollars-in-identifiers} Accept
6652 .It Fl fextended-identifiers
6653 Accept universal character names in identifiers.
6654 This option is experimental; in a future version of GCC, it will be enabled by default for C99 and C++.
6656 .It Fl fpreprocessed
6657 Indicate to the preprocessor that the input file has already been preprocessed.
6658 This suppresses things like macro expansion, trigraph conversion, escaped newline splicing, and processing of most directives.
6659 The preprocessor still recognizes and removes comments, so that you can pass a file preprocessed with
6661 to the compiler without problems.
6662 In this mode the integrated preprocessor is little more than a tokenizer for the front ends.
6665 is implicit if the input file has one of the extensions
6670 These are the extensions that GCC uses for preprocessed files created by
6673 .It Fl ftabstop= Ns Ar width
6674 Set the distance between tab stops.
6675 This helps the preprocessor report correct column numbers in warnings or errors, even if tabs appear on the line.
6676 If the value is less than 1 or greater than 100, the option is ignored.
6679 .It Fl fexec-charset= Ns Ar charset
6680 Set the execution character set, used for string and character constants.
6681 The default is UTF-8.
6683 can be any encoding supported by the system's
6687 .It Fl fwide-exec-charset= Ns Ar charset
6688 Set the wide execution character set, used for wide string and character constants.
6689 The default is UTF-32 or UTF-16, whichever corresponds to the width of
6694 can be any encoding supported by the system's
6696 library routine; however, you will have problems with encodings that do not fit exactly in
6699 .It Fl finput-charset= Ns Ar charset
6700 Set the input character set, used for translation from the character set of the input file to the source character set used by GCC.
6701 If the locale does not specify, or GCC cannot get this information from the locale, the default is UTF-8.
6702 This can be overridden by either the locale or this command line option.
6703 Currently the command line option takes precedence if there's a conflict.
6705 can be any encoding supported by the system's
6709 .It Fl fworking-directory
6710 Enable generation of linemarkers in the preprocessor output that will let the compiler know the current working directory at the time of preprocessing.
6711 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.
6712 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.
6713 This option is implicitly enabled if debugging information is enabled, but this can be inhibited with the negated form
6714 .Fl fno-working-directory .
6717 flag is present in the command line, this option has no effect, since no
6719 directives are emitted whatsoever.
6721 .It Fl fno-show-column
6722 Do not print column numbers in diagnostics.
6723 This may be necessary if diagnostics are being scanned by a program that does not understand the column numbers, such as
6726 .It Fl A Ar predicate Ns = Ns Ar answer
6727 Make an assertion with the predicate
6731 This form is preferred to the older form
6736 which is still supported, because it does not use shell special characters.
6738 .It Fl A Fl Ns Ar predicate Ns = Ns Ar answer
6739 Cancel an assertion with the predicate
6746 is a sequence of one or more of the following characters, and must not be preceded by a space.
6747 Other characters are interpreted by the compiler proper, or reserved for future versions of GCC, and so are silently ignored.
6748 If you specify characters whose behavior conflicts, the result is undefined.
6752 Instead of the normal output, generate a list of
6754 directives for all the macros defined during the execution of the preprocessor, including predefined macros.
6755 This gives you a way of finding out what is predefined in your version of the preprocessor.
6756 Assuming you have no file
6760 .Bd -literal -offset indent
6761 touch foo.h; cpp -dM foo.h
6763 will show all the predefined macros.
6768 except in two respects: it does
6770 include the predefined macros, and it outputs
6774 directives and the result of preprocessing.
6775 Both kinds of output go to the standard output file.
6780 but emit only the macro names, not their expansions.
6785 directives in addition to the result of preprocessing.
6789 Inhibit generation of linemarkers in the output from the preprocessor.
6790 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.
6793 Do not discard comments.
6794 All comments are passed through to the output file, except for comments in processed directives, which are deleted along with the directive.
6796 You should be prepared for side effects when using
6798 it causes the preprocessor to treat comments as tokens in their own right.
6799 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
6803 Do not discard comments, including during macro expansion.
6806 except that comments contained within macros are also passed through to the output file where the macro is expanded.
6808 In addition to the side-effects of the
6812 option causes all C++-style comments inside a macro to be converted to C-style comments.
6813 This is to prevent later use of that macro from inadvertently commenting out the remainder of the source line.
6817 option is generally used to support lint comments.
6819 .It Fl traditional-cpp
6820 Try to imitate the behavior of old-fashioned C preprocessors, as opposed to ISO C preprocessors.
6823 Process trigraph sequences.
6824 These are three-character sequences, all starting with
6826 that are defined by ISO C to stand for single characters.
6833 is a character constant for a newline.
6834 By default, GCC ignores trigraphs, but in standard-conforming modes it converts them.
6841 The nine trigraphs and their replacements are
6843 .Bd -literal -offset indent
6844 Trigraph: ??( ??) ??\*[Lt] ??\*[Gt] ??= ??/ ??' ??! ??-
6845 Replacement: [ ] { } # \e ^ | ~
6848 Enable special code to work around file systems which only permit very short file names, such as MS-DOS.
6852 Print text describing all the command line options instead of preprocessing anything.
6856 Print out GNU CPP's version number at the beginning of execution, and report the final form of the include path.
6859 Print the name of each header file used, in addition to other normal activities.
6860 Each name is indented to show how deep in the
6863 Precompiled header files are also printed, even if they are found to be invalid; an invalid precompiled header file is printed with
6865 and a valid one with
6870 Print out GNU CPP's version number.
6871 With one dash, proceed to preprocess as normal.
6872 With two dashes, exit immediately.
6875 .Ss Passing Options to the Assembler
6876 You can pass options to the assembler.
6879 .It Fl Wa, Ns Ar option
6882 as an option to the assembler.
6885 contains commas, it is split into multiple options at the commas.
6887 .It Fl Xassembler Ar option
6890 as an option to the assembler.
6891 You can use this to supply system-specific assembler options which GCC does not know how to recognize.
6893 If you want to pass an option that takes an argument, you must use
6895 twice, once for the option and once for the argument.
6898 .Ss Options for Linking
6899 These options come into play when the compiler links object files into an executable output file.
6900 They are meaningless if the compiler is not doing a link step.
6903 .It Em object-file-name Ns
6904 A file name that does not end in a special recognized suffix is considered to name an object file or library.
6905 (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.
6910 If any of these options is used, then the linker is not run, and object file names should not be used as arguments.
6912 .It Fl l Ns Ar library
6914 Search the library named
6917 (The second alternative with the library as a separate argument is only for POSIX compliance and is not recommended.)
6919 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.
6930 refers to functions in
6932 those functions may not be loaded.
6934 The linker searches a standard list of directories for the library, which is actually a file named
6936 The linker then uses this file as if it had been specified precisely by name.
6938 The directories searched include several standard system directories plus any that you specify with
6941 Normally the files found this way are library files---archive files whose members are object files.
6942 The linker handles an archive file by scanning through it for members which define symbols that have so far been referenced but not defined.
6943 But if the file that is found is an ordinary object file, it is linked in the usual fashion.
6944 The only difference between using an
6946 option and specifying a file name is that
6954 and searches several directories.
6957 You need this special case of the
6959 option in order to link an Objective-C or Objective-C++ program.
6962 Do not use the standard system startup files when linking.
6963 The standard system libraries are used normally, unless
6969 .It Fl nodefaultlibs
6970 Do not use the standard system libraries when linking.
6971 Only the libraries you specify will be passed to the linker.
6972 The standard startup files are used normally, unless
6975 The compiler may generate calls to
6981 These entries are usually resolved by entries in libc.
6982 These entry points should be supplied through some other mechanism when this option is specified.
6985 Do not use the standard system startup files or libraries when linking.
6986 No startup files and only the libraries you specify will be passed to the linker.
6987 The compiler may generate calls to
6993 These entries are usually resolved by entries in libc.
6994 These entry points should be supplied through some other mechanism when this option is specified.
6996 One of the standard libraries bypassed by
7002 a library of internal subroutines that GCC uses to overcome shortcomings of particular machines, or special needs for some languages.
7004 In most cases, you need
7006 even when you want to avoid other standard libraries.
7007 In other words, when you specify
7011 you should usually specify
7014 This ensures that you have no unresolved references to internal GCC library subroutines.
7017 used to ensure C++ constructors will be called.)
7020 Produce a position independent executable on targets which support it.
7021 For predictable results, you must also specify the same set of options that were used to generate code
7024 or model suboptions) when you specify this option.
7029 to the ELF linker, on targets that support it.
7030 This instructs the linker to add all symbols, not only used ones, to the dynamic symbol table.
7031 This option is needed for some uses of
7033 or to allow obtaining backtraces from within a program.
7036 Remove all symbol table and relocation information from the executable.
7039 On systems that support dynamic linking, this prevents linking with the shared libraries.
7040 On other systems, this option has no effect.
7043 Produce a shared object which can then be linked with other objects to form an executable.
7044 Not all systems support this option.
7045 For predictable results, you must also specify the same set of options that were used to generate code
7048 or model suboptions) when you specify this option.[1]
7050 .It Fl shared-libgcc
7051 .It Fl static-libgcc
7052 On systems that provide
7054 as a shared library, these options force the use of either the shared or static version respectively.
7055 If no shared version of
7057 was built when the compiler was configured, these options have no effect.
7059 There are several situations in which an application should use the shared
7061 instead of the static version.
7062 The most common of these is when the application wishes to throw and catch exceptions across different shared libraries.
7063 In that case, each of the libraries as well as the application itself should use the shared
7066 Therefore, the G++ and GCJ drivers automatically add
7068 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.
7070 If, instead, you use the GCC driver to create shared libraries, you may find that they will not always be linked with the shared
7072 If GCC finds, at its configuration time, that you have a non-GNU linker or a GNU linker that does not support option
7074 it will link the shared version of
7076 into shared libraries by default.
7077 Otherwise, it will take advantage of the linker and optimize away the linking with the shared version of
7079 linking with the static version of libgcc by default.
7080 This allows exceptions to propagate through such shared libraries, without incurring relocation costs at library load time.
7082 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
7084 such that it is linked with the shared
7088 Bind references to global symbols when building a shared object.
7089 Warn about any unresolved references (unless overridden by the link editor option
7090 .Fl Xlinker Fl z Fl Xlinker Ar defs ) .
7091 Only a few systems support this option.
7093 .It Fl Xlinker Ar option
7096 as an option to the linker.
7097 You can use this to supply system-specific linker options which GCC does not know how to recognize.
7099 If you want to pass an option that takes an argument, you must use
7101 twice, once for the option and once for the argument.
7102 For example, to pass
7103 .Fl assert Ar definitions ,
7105 .Fl Xlinker Fl assert Fl Xlinker Ar definitions .
7106 It does not work to write
7107 .Sy -Xlinker \&"-assert definitions" ,
7108 because this passes the entire string as a single argument, which is not what the linker expects.
7110 .It Fl Wl, Ns Ar option
7113 as an option to the linker.
7116 contains commas, it is split into multiple options at the commas.
7121 is undefined, to force linking of library modules to define it.
7124 multiple times with different symbols to force loading of additional library modules.
7127 .Ss Options for Directory Search
7128 These options specify directories to search for header files, for libraries and for parts of the compiler:
7134 to the head of the list of directories to be searched for header files.
7135 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.
7136 However, you should not use this option to add directories that contain vendor-supplied system header files (use
7139 If you use more than one
7141 option, the directories are scanned in left-to-right order; the standard system directories come after.
7143 If a standard system include directory, or a directory specified with
7145 is also specified with
7149 option will be ignored.
7150 The directory will still be searched but as a system directory at its normal position in the system include chain.
7151 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.
7152 If you really need to change the search order for system directories, use the
7158 .It Fl iquote Ns Ar dir
7161 to the head of the list of directories to be searched for header files only for the case of
7165 they are not searched for
7175 to the list of directories to be searched for
7178 .It Fl B Ns Ar prefix
7179 This option specifies where to find the executables, libraries, include files, and data files of the compiler itself.
7181 The compiler driver program runs one or more of the subprograms
7189 as a prefix for each program it tries to run, both with and without
7195 For each subprogram to be run, the compiler driver first tries the
7198 If that name is not found, or if
7200 was not specified, the driver tries two standard prefixes, which are
7203 .Pa /usr/local/lib/gcc/ .
7204 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
7206 environment variable.
7208 The compiler will check to see if the path provided by the
7210 refers to a directory, and if necessary it will add a directory separator character at the end of the path.
7213 prefixes that effectively specify directory names also apply to libraries in the linker, because the compiler translates these options into
7215 options for the linker.
7216 They also apply to includes files in the preprocessor, because the compiler translates these options into
7218 options for the preprocessor.
7219 In this case, the compiler appends
7223 The run-time support file
7225 can also be searched for using the
7228 If it is not found there, the two standard prefixes above are tried, and that is all.
7229 The file is left out of the link if it is not found by those means.
7231 Another way to specify a prefix much like the
7233 prefix is to use the environment variable
7234 .Sy GCC_EXEC_PREFIX .
7236 As a special kludge, if the path provided by
7242 is a number in the range 0 to 9, then it will be replaced by
7244 This is to help with boot-strapping the compiler.
7246 .It Fl specs= Ns Ar file
7249 after the compiler reads in the standard
7251 file, in order to override the defaults that the
7253 driver program uses when determining what switches to pass to
7260 .Fl specs= Ns Ar file
7261 can be specified on the command line, and they are processed in order, from left to right.
7263 .It Fl -sysroot= Ns Ar dir
7266 as the logical root directory for headers and libraries.
7267 For example, if the compiler would normally search for headers in
7271 it will instead search
7276 If you use both this option and the
7280 option will apply to libraries, but the
7282 option will apply to header files.
7284 The GNU linker (beginning with version 2.16) has the necessary support for this option.
7285 If your linker does not support this option, the header file aspect of
7287 will still work, but the library aspect will not.
7290 This option has been deprecated.
7295 directories before the
7299 Any directories you specify with
7303 option are searched only for the case of
7307 they are not searched for
7312 If additional directories are specified with
7316 these directories are searched for all
7322 directories are used this way.)
7326 option inhibits the use of the current directory (where the current input file came from) as the first search directory for
7330 There is no way to override this effect of
7334 you can specify searching the directory which was current when the compiler was invoked.
7335 That is not exactly the same as what the preprocessor does by default, but it is often satisfactory.
7338 does not inhibit the use of the standard system directories for header files.
7346 .Ss Specifying Target Machine and Compiler Version
7347 The usual way to run GCC is to run the executable called
7350 .Pa \*[Lt]machine\*[Gt]-gcc
7351 when cross-compiling, or
7352 .Pa \*[Lt]machine\*[Gt]-gcc-\*[Lt]version\*[Gt]
7353 to run a version other than the one that was installed last.
7354 Sometimes this is inconvenient, so GCC provides options that will switch to another cross-compiler or version.
7360 specifies the target machine for compilation.
7362 The value to use for
7364 is the same as was specified as the machine type when configuring GCC as a cross-compiler.
7365 For example, if a cross-compiler was configured with
7366 .Sy configure arm-elf ,
7367 meaning to compile for an arm processor with elf binaries, then you would specify
7369 to run that cross compiler.
7370 Because there are other options beginning with
7372 the configuration must contain a hyphen.
7377 specifies which version of GCC to run.
7378 This is useful when multiple versions are installed.
7383 meaning to run GCC version 4.0.
7390 options work by running the
7391 .Pa \*[Lt]machine\*[Gt]-gcc-\*[Lt]version\*[Gt]
7392 executable, so there's no real reason to use them if you can just run that directly.
7393 .Ss Hardware Models and Configurations
7394 Earlier we discussed the standard option
7396 which chooses among different installed compilers for completely different target machines, such as VAX vs. 68000 vs. 80386.
7398 In addition, each of these target machine types can have its own special options, starting with
7400 to choose among various hardware models or configurations---for example, 68010 vs 68020, floating coprocessor or none.
7401 A single installed version of the compiler can compile for any model or configuration, according to the options specified.
7403 Some configurations of the compiler also support additional special options, usually for compatibility with other compilers on the same platform.
7407 These options are defined for ARC implementations:
7411 Compile code for little endian mode.
7412 This is the default.
7415 Compile code for big endian mode.
7418 Prepend the name of the cpu to all public symbol names.
7419 In multiple-processor systems, there are many ARC variants with different instruction and register set characteristics.
7420 This flag prevents code compiled for one cpu to be linked with code compiled for another.
7421 No facility exists for handling variants that are "almost identical".
7422 This is an all or nothing option.
7424 .It Fl mcpu= Ns Ar cpu
7425 Compile code for ARC variant
7427 Which variants are supported depend on the configuration.
7428 All variants support
7430 this is the default.
7432 .It Fl mtext= Ns Ar text-section
7433 .It Fl mdata= Ns Ar data-section
7434 .It Fl mrodata= Ns Ar readonly-data-section
7435 Put functions, data, and readonly data in
7439 .Em readonly-data-section
7440 respectively by default.
7441 This can be overridden with the
7449 options are defined for Advanced RISC Machines (ARM) architectures:
7452 .It Fl mabi= Ns Ar name
7453 Generate code for the specified ABI.
7454 Permissible values are:
7463 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.
7465 .Fl fomit-frame-pointer
7466 with this option will cause the stack frames not to be generated for leaf functions.
7468 .Fl mno-apcs-frame .
7471 This is a synonym for
7474 .It Fl mthumb-interwork
7475 Generate code which supports calling between the ARM and Thumb instruction sets.
7476 Without this option the two instruction sets cannot be reliably used inside one program.
7478 .Fl mno-thumb-interwork ,
7479 since slightly larger code is generated when
7480 .Fl mthumb-interwork
7483 .It Fl mno-sched-prolog
7484 Prevent the reordering of instructions in the function prolog, or the merging of those instruction with the instructions in the function's body.
7485 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.
7490 Generate output containing floating point instructions.
7491 This is the default.
7494 Generate output containing library calls for floating point.
7496 the requisite libraries are not available for all ARM targets.
7497 Normally the facilities of the machine's usual C compiler are used, but this cannot be done directly in cross-compilation.
7498 You must make your own arrangements to provide suitable library functions for cross-compilation.
7501 changes the calling convention in the output file; therefore, it is only useful if you compile
7503 of a program with this option.
7504 In particular, you need to compile
7506 the library that comes with GCC, with
7508 in order for this to work.
7510 .It Fl mfloat-abi= Ns Ar name
7511 Specifies which ABI to use for floating point values.
7512 Permissible values are:
7527 allows the generation of floating point instructions, but still uses the soft-float calling conventions.
7529 .It Fl mlittle-endian
7530 Generate code for a processor running in little-endian mode.
7531 This is the default for all standard configurations.
7534 Generate code for a processor running in big-endian mode; the default is to compile code for a little-endian processor.
7536 .It Fl mwords-little-endian
7537 This option only applies when generating code for big-endian processors.
7538 Generate code for a little-endian word order but a big-endian byte order.
7539 That is, a byte order of the form
7541 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.
7543 .It Fl mcpu= Ns Ar name
7544 This specifies the name of the target ARM processor.
7545 GCC uses this name to determine what kind of instructions it can emit when generating assembly code.
7546 Permissible names are:
7604 .It Fl mtune= Ns Ar name
7605 This option is very similar to the
7607 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
7610 For some ARM implementations better performance can be obtained by using this option.
7612 .It Fl march= Ns Ar name
7613 This specifies the name of the target ARM architecture.
7614 GCC uses this name to determine what kind of instructions it can emit when generating assembly code.
7615 This option can be used in conjunction with or instead of the
7618 Permissible names are:
7633 .It Fl mfpu= Ns Ar name
7634 .It Fl mfpe= Ns Ar number
7635 .It Fl mfp= Ns Ar number
7636 This specifies what floating point hardware (or hardware emulation) is available on the target.
7637 Permissible names are:
7651 for compatibility with older versions of GCC.
7655 is specified this specifies the format of floating point values.
7657 .It Fl mstructure-size-boundary= Ns Ar n
7658 The size of all structures and unions will be rounded up to a multiple of the number of bits set by this option.
7659 Permissible values are 8, 32 and 64.
7660 The default value varies for different toolchains.
7661 For the COFF targeted toolchain the default value is 8.
7662 A value of 64 is only allowed if the underlying ABI supports it.
7664 Specifying the larger number can produce faster, more efficient code, but can also increase the size of the program.
7665 Different values are potentially incompatible.
7666 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.
7668 .It Fl mabort-on-noreturn
7669 Generate a call to the function
7674 It will be executed if the function tries to return.
7677 .It Fl mno-long-calls
7678 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.
7679 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.
7681 Even if this switch is enabled, not all function calls will be turned into long calls.
7682 The heuristic is that static functions, functions which have the
7684 attribute, functions that are inside the scope of a
7685 .Sy #pragma no_long_calls
7686 directive and functions whose definitions have already been compiled within the current compilation unit, will not be turned into long calls.
7687 The exception to this rule is that weak function definitions, functions with the
7691 attribute, and functions that are within the scope of a
7692 .Sy #pragma long_calls
7693 directive, will always be turned into long calls.
7695 This feature is not enabled by default.
7698 will restore the default behavior, as will placing the function calls within the scope of a
7699 .Sy #pragma long_calls_off
7701 Note these switches have no effect on how the compiler generates code to handle function calls via function pointers.
7703 .It Fl mnop-fun-dllimport
7704 Disable support for the
7708 .It Fl msingle-pic-base
7709 Treat the register used for PIC addressing as read-only, rather than loading it in the prologue for each function.
7710 The run-time system is responsible for initializing this register with an appropriate value before execution begins.
7712 .It Fl mpic-register= Ns Ar reg
7713 Specify the register to be used for PIC addressing.
7714 The default is R10 unless stack-checking is enabled, when R9 is used.
7716 .It Fl mcirrus-fix-invalid-insns
7717 Insert NOPs into the instruction stream to in order to work around problems with invalid Maverick instruction combinations.
7718 This option is only valid if the
7720 option has been used to enable generation of instructions for the Cirrus Maverick floating point co-processor.
7721 This option is not enabled by default, since the problem is only present in older Maverick implementations.
7722 The default can be re-enabled by use of the
7723 .Fl mno-cirrus-fix-invalid-insns
7726 .It Fl mpoke-function-name
7727 Write the name of each function into the text section, directly preceding the function prologue.
7728 The generated code is similar to this:
7730 .Bd -literal -offset indent
7732 .ascii "arm_poke_function_name", 0
7735 .word 0xff000000 + (t1 - t0)
7736 arm_poke_function_name
7738 stmfd sp!, {fp, ip, lr, pc}
7741 When performing a stack backtrace, code can inspect the value of
7745 If the trace function then looks at location
7747 and the top 8 bits are set, then we know that there is a function name embedded immediately preceding this location and has length
7748 .Va ((pc[-3]) & 0xff000000) .
7751 Generate code for the 16-bit Thumb instruction set.
7752 The default is to use the 32-bit ARM instruction set.
7755 Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all non-leaf functions.
7756 (A leaf function is one that does not call any other functions.) The default is
7757 .Fl mno-tpcs-frame .
7759 .It Fl mtpcs-leaf-frame
7760 Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all leaf functions.
7761 (A leaf function is one that does not call any other functions.) The default is
7762 .Fl mno-apcs-leaf-frame .
7764 .It Fl mcallee-super-interworking
7765 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.
7766 This allows these functions to be called from non-interworking code.
7768 .It Fl mcaller-super-interworking
7769 Allows calls via function pointers (including virtual functions) to execute correctly regardless of whether the target code has been compiled for interworking or not.
7770 There is a small overhead in the cost of executing a function pointer if this option is enabled.
7772 .It Fl mtp= Ns Ar name
7773 Specify the access model for the thread local storage pointer.
7774 The valid models are
7776 which generates calls to
7777 .Va __aeabi_read_tp ,
7779 which fetches the thread pointer from
7781 directly (supported in the arm6k architecture), and
7783 which uses the best available method for the selected processor.
7784 The default setting is
7789 These options are defined for AVR implementations:
7792 .It Fl mmcu= Ns Ar mcu
7793 Specify ATMEL AVR instruction set or MCU type.
7795 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).
7797 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).
7799 Instruction set avr3 is for the classic AVR core with up to 128K program memory space (MCU types: atmega103, atmega603, at43usb320, at76c711).
7801 Instruction set avr4 is for the enhanced AVR core with up to 8K program memory space (MCU types: atmega8, atmega83, atmega85).
7803 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).
7806 Output instruction sizes to the asm file.
7808 .It Fl minit-stack= Ns Ar N
7809 Specify the initial stack address, which may be a symbol or numeric value,
7813 .It Fl mno-interrupts
7814 Generated code is not compatible with hardware interrupts.
7815 Code size will be smaller.
7817 .It Fl mcall-prologues
7818 Functions prologues/epilogues expanded as call to appropriate subroutines.
7819 Code size will be smaller.
7821 .It Fl mno-tablejump
7822 Do not generate tablejump insns which sometimes increase code size.
7825 Change only the low 8 bits of the stack pointer.
7828 Assume int to be 8 bit integer.
7829 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.
7830 Please note that this option does not comply to the C standards, but it will provide you with smaller code size.
7833 .It Sy Blackfin Options
7835 .It Fl momit-leaf-frame-pointer
7836 Don't keep the frame pointer in a register for leaf functions.
7837 This avoids the instructions to save, set up and restore frame pointers and makes an extra register available in leaf functions.
7839 .Fl fomit-frame-pointer
7840 removes the frame pointer for all functions which might make debugging harder.
7842 .It Fl mspecld-anomaly
7843 When enabled, the compiler will ensure that the generated code does not contain speculative loads after jump instructions.
7844 This option is enabled by default.
7846 .It Fl mno-specld-anomaly
7847 Don't generate extra code to prevent speculative loads from occurring.
7849 .It Fl mcsync-anomaly
7850 When enabled, the compiler will ensure that the generated code does not contain CSYNC or SSYNC instructions too soon after conditional branches.
7851 This option is enabled by default.
7853 .It Fl mno-csync-anomaly
7854 Don't generate extra code to prevent CSYNC or SSYNC instructions from occurring too soon after a conditional branch.
7857 When enabled, the compiler is free to take advantage of the knowledge that the entire program fits into the low 64k of memory.
7860 Assume that the program is arbitrarily large.
7861 This is the default.
7863 .It Fl mid-shared-library
7864 Generate code that supports shared libraries via the library ID method.
7865 This allows for execute in place and shared libraries in an environment without virtual memory management.
7869 .It Fl mno-id-shared-library
7870 Generate code that doesn't assume ID based shared libraries are being used.
7871 This is the default.
7873 .It Fl mshared-library-id=n
7874 Specified the identification number of the ID based shared library being compiled.
7875 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.
7878 .It Fl mno-long-calls
7879 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.
7880 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.
7882 This feature is not enabled by default.
7885 will restore the default behavior.
7886 Note these switches have no effect on how the compiler generates code to handle function calls via function pointers.
7890 These options are defined specifically for the CRIS ports.
7893 .It Fl march= Ns Ar architecture-type
7894 .It Fl mcpu= Ns Ar architecture-type
7895 Generate code for the specified architecture.
7897 .Em architecture-type
7903 for respectively ETRAX\~4, ETRAX\~100, and ETRAX\~100\~LX.
7906 except for cris-axis-linux-gnu, where the default is
7909 .It Fl mtune= Ns Ar architecture-type
7911 .Em architecture-type
7912 everything applicable about the generated code, except for the ABI and the set of available instructions.
7914 .Em architecture-type
7916 .Fl march= Ns Ar architecture-type .
7918 .It Fl mmax-stack-frame= Ns Ar n
7919 Warn when the stack frame of a function exceeds
7923 .It Fl melinux-stacksize= Ns Ar n
7924 Only available with the
7927 Arranges for indications in the program to the kernel loader that the stack of the program should be set to
7943 .It Fl mmul-bug-workaround
7944 .It Fl mno-mul-bug-workaround
7945 Work around a bug in the
7949 instructions for CPU models where it applies.
7950 This option is active by default.
7953 Enable CRIS-specific verbose debug-related information in the assembly code.
7954 This option also has the effect to turn off the
7956 formatted-code indicator to the assembler at the beginning of the assembly file.
7959 Do not use condition-code results from previous instruction; always emit compare and test instructions before use of condition codes.
7961 .It Fl mno-side-effects
7962 Do not emit instructions with side-effects in addressing modes other than post-increment.
7965 .It Fl mno-stack-align
7967 .It Fl mno-data-align
7969 .It Fl mno-const-align
7970 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.
7971 The default is to arrange for 32-bit alignment.
7972 ABI details such as structure layout are not affected by these options.
7977 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.
7978 The default is 32-bit alignment.
7980 .It Fl mno-prologue-epilogue
7981 .It Fl mprologue-epilogue
7983 .Fl mno-prologue-epilogue ,
7984 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.
7985 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.
7993 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.
7998 Legacy no-op option only recognized with the cris-axis-aout target.
8001 Legacy no-op option only recognized with the cris-axis-elf and cris-axis-linux-gnu targets.
8004 Only recognized with the cris-axis-aout target, where it selects a GNU/linux-like multilib, include files and instruction set for
8008 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
8011 This option, recognized for the cris-axis-aout and cris-axis-elf arranges to link with input-output functions from a simulator library.
8012 Code, initialized data and zero-initialized data are allocated consecutively.
8017 but pass linker options to locate initialized data at 0x40000000 and zero-initialized data at 0x80000000.
8021 These options are defined specifically for the CRX ports.
8025 Enable the use of multiply-accumulate instructions.
8026 Disabled by default.
8029 Push instructions will be used to pass outgoing arguments when functions are called.
8033 .It Sy Darwin Options
8034 These options are defined for all architectures running the Darwin operating system.
8036 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.
8037 Apple's GCC on Darwin does create "fat" files if multiple
8039 options are used; it does so by running the compiler or linker multiple times and joining the results together with
8042 The subtype of the file created (like
8048 is determined by the flags that specify the ISA that GCC is targetting, like
8053 .Fl force_cpusubtype_ALL
8054 option can be used to override this.
8056 The Darwin tools vary in their behavior when presented with an ISA mismatch.
8059 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
8062 The linker for shared libraries,
8063 .Pa /usr/bin/libtool ,
8064 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
8069 The linker for executables,
8071 will quietly give the executable the most restrictive subtype of any of its input files.
8075 Add the framework directory
8077 to the head of the list of directories to be searched for header files.
8078 These directories are interleaved with those specified by
8080 options and are scanned in a left-to-right order.
8082 A framework directory is a directory with frameworks in it.
8083 A framework is a directory with a
8086 .Sy \&"PrivateHeaders"
8087 directory contained directly in it that ends in
8088 .Sy \&".framework" .
8089 The name of a framework is the name of this directory excluding the
8090 .Sy \&".framework" .
8091 Headers associated with the framework are found in one of those two directories, with
8093 being searched first.
8094 A subframework is a framework directory that is in a framework's
8097 Includes of subframework headers can only appear in a header of a framework that contains the subframework, or in a sibling subframework header.
8098 Two subframeworks are siblings if they occur in the same framework.
8099 A subframework should not have the same name as a framework, a warning will be issued if this is violated.
8100 Currently a subframework cannot have subframeworks, in the future, the mechanism may be extended to support this.
8101 The standard frameworks can be found in
8102 .Sy \&"/System/Library/Frameworks"
8104 .Sy \&"/Library/Frameworks" .
8105 An example include looks like
8106 .Va #include \*[Lt]Framework/header.h\*[Gt] ,
8109 denotes the name of the framework and header.h is found in the
8110 .Sy \&"PrivateHeaders"
8116 Emit debugging information for symbols that are used.
8117 For STABS debugging format, this enables
8118 .Fl feliminate-unused-debug-symbols .
8119 This is by default ON.
8122 Emit debugging information for all symbols and types.
8124 .It Fl mmacosx-version-min= Ns Ar version
8125 The earliest version of MacOS X that this executable will run on is
8135 The default for this option is to make choices that seem to be most useful.
8137 .It Fl mone-byte-bool
8138 Override the defaults for
8141 .Sy sizeof(bool)==1 .
8146 when compiling for Darwin/PowerPC and
8148 when compiling for Darwin/x86, so this option has no effect on x86.
8153 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
8154 Using this switch may require recompiling all other modules in a program, including system libraries.
8155 Use this switch to conform to a non-default data model.
8157 .It Fl mfix-and-continue
8158 .It Fl ffix-and-continue
8159 .It Fl findirect-data
8160 Generate code suitable for fast turn around development.
8161 Needed to enable gdb to dynamically load
8163 files into already running programs.
8166 .Fl ffix-and-continue
8167 are provided for backwards compatibility.
8170 Loads all members of static archive libraries.
8171 See man ld(1) for more information.
8173 .It Fl arch_errors_fatal
8174 Cause the errors having to do with files that have the wrong architecture to be fatal.
8177 Causes the output file to be marked such that the dynamic linker will bind all undefined references when the file is loaded or launched.
8180 Produce a Mach-o bundle format file.
8181 See man ld(1) for more information.
8183 .It Fl bundle_loader Ar executable
8184 This option specifies the
8186 that will be loading the build output file being linked.
8187 See man ld(1) for more information.
8190 When passed this option, GCC will produce a dynamic library instead of an executable when linking, using the Darwin
8194 .It Fl force_cpusubtype_ALL
8195 This causes GCC's output file to have the
8197 subtype, instead of one controlled by the
8203 .It Fl allowable_client Ar client_name
8205 .It Fl compatibility_version
8206 .It Fl current_version
8208 .It Fl dependency-file
8210 .It Fl dylinker_install_name
8212 .It Fl exported_symbols_list
8214 .It Fl flat_namespace
8215 .It Fl force_flat_namespace
8216 .It Fl headerpad_max_install_names
8220 .It Fl keep_private_externs
8222 .It Fl multiply_defined
8223 .It Fl multiply_defined_unused
8225 .It Fl no_dead_strip_inits_and_terms
8226 .It Fl nofixprebinding
8229 .It Fl noseglinkedit
8230 .It Fl pagezero_size
8232 .It Fl prebind_all_twolevel_modules
8233 .It Fl private_bundle
8234 .It Fl read_only_relocs
8236 .It Fl sectobjectsymbols
8240 .It Fl sectobjectsymbols
8243 .It Fl segs_read_only_addr
8244 .It Fl segs_read_write_addr
8245 .It Fl seg_addr_table
8246 .It Fl seg_addr_table_filename
8249 .It Fl segs_read_only_addr
8250 .It Fl segs_read_write_addr
8251 .It Fl single_module
8255 .It Fl twolevel_namespace
8258 .It Fl unexported_symbols_list
8259 .It Fl weak_reference_mismatches
8261 These options are passed to the Darwin linker.
8262 The Darwin linker man page describes them in detail.
8265 .It Sy DEC Alpha Options
8268 options are defined for the DEC Alpha implementations:
8271 .It Fl mno-soft-float
8273 Use (do not use) the hardware floating-point instructions for floating-point operations.
8276 is specified, functions in
8278 will be used to perform floating-point operations.
8279 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.
8280 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.
8282 Note that Alpha implementations without floating-point operations are required to have floating-point registers.
8286 Generate code that uses (does not use) the floating-point register set.
8290 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
8294 This is a non-standard calling sequence, so any function with a floating-point argument or return value called by code compiled with
8296 must also be compiled with that option.
8298 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.
8301 The Alpha architecture implements floating-point hardware optimized for maximum performance.
8302 It is mostly compliant with the IEEE floating point standard.
8303 However, for full compliance, software assistance is required.
8304 This option generates code fully IEEE compliant code
8308 is not maintained (see below).
8309 If this option is turned on, the preprocessor macro
8311 is defined during compilation.
8312 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.
8313 Other Alpha compilers call this option
8314 .Fl ieee_with_no_inexact .
8316 .It Fl mieee-with-inexact
8319 except the generated code also maintains the IEEE
8321 Turning on this option causes the generated code to implement fully-compliant IEEE math.
8325 is defined as a preprocessor macro.
8326 On some Alpha implementations the resulting code may execute significantly slower than the code generated by default.
8327 Since there is very little code that depends on the
8329 you should normally not specify this option.
8330 Other Alpha compilers call this option
8331 .Fl ieee_with_inexact .
8333 .It Fl mfp-trap-mode= Ns Ar trap-mode
8334 This option controls what floating-point related traps are enabled.
8335 Other Alpha compilers call this option
8336 .Fl fptm Ar trap-mode .
8337 The trap mode can be set to one of four values:
8341 This is the default (normal) setting.
8342 The only traps that are enabled are the ones that cannot be disabled in software (e.g., division by zero trap).
8345 In addition to the traps enabled by
8347 underflow traps are enabled as well.
8352 but the instructions are marked to be safe for software completion (see Alpha architecture manual for details).
8357 but inexact traps are enabled as well.
8360 .It Fl mfp-rounding-mode= Ns Ar rounding-mode
8361 Selects the IEEE rounding mode.
8362 Other Alpha compilers call this option
8363 .Fl fprm Ar rounding-mode .
8370 Normal IEEE rounding mode.
8371 Floating point numbers are rounded towards the nearest machine number or towards the even machine number in case of a tie.
8374 Round towards minus infinity.
8377 Chopped rounding mode.
8378 Floating point numbers are rounded towards zero.
8381 Dynamic rounding mode.
8382 A field in the floating point control register
8384 see Alpha architecture reference manual) controls the rounding mode in effect.
8385 The C library initializes this register for rounding towards plus infinity.
8386 Thus, unless your program modifies the
8389 corresponds to round towards plus infinity.
8392 .It Fl mtrap-precision= Ns Ar trap-precision
8393 In the Alpha architecture, floating point traps are imprecise.
8394 This means without software assistance it is impossible to recover from a floating trap and program execution normally needs to be terminated.
8395 GCC can generate code that can assist operating system trap handlers in determining the exact location that caused a floating point trap.
8396 Depending on the requirements of an application, different levels of precisions can be selected:
8401 This option is the default and means a trap handler can only identify which program caused a floating point exception.
8405 The trap handler can determine the function that caused a floating point exception.
8408 Instruction precision.
8409 The trap handler can determine the exact instruction that caused a floating point exception.
8412 Other Alpha compilers provide the equivalent options called
8415 .Fl resumption_safe .
8417 .It Fl mieee-conformant
8418 This option marks the generated code as IEEE conformant.
8419 You must not use this option unless you also specify
8420 .Fl mtrap-precision=i
8422 .Fl mfp-trap-mode=su
8424 .Fl mfp-trap-mode=sui .
8425 Its only effect is to emit the line
8427 in the function prologue of the generated assembly file.
8428 Under DEC Unix, this has the effect that IEEE-conformant math library routines will be linked in.
8430 .It Fl mbuild-constants
8431 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.
8432 If it cannot, it will output the constant as a literal and generate code to load it from the data segment at runtime.
8434 Use this option to require GCC to construct
8436 integer constants using code, even if it takes more instructions (the maximum is six).
8438 You would typically use this option to build a shared library dynamic loader.
8439 Itself a shared library, it must relocate itself in memory before it can find the variables and constants in its own data segment.
8443 Select whether to generate code to be assembled by the vendor-supplied assembler
8445 or by the GNU assembler
8456 Indicate whether GCC should generate code to use the optional BWX, CIX, FIX and MAX instruction sets.
8457 The default is to use the instruction sets supported by the CPU type specified via
8459 option or that of the CPU on which GCC was built if none was specified.
8463 Generate code that uses (does not use) VAX F and G floating point arithmetic instead of IEEE single and double precision.
8465 .It Fl mexplicit-relocs
8466 .It Fl mno-explicit-relocs
8467 Older Alpha assemblers provided no way to generate symbol relocations except via assembler macros.
8468 Use of these macros does not allow optimal instruction scheduling.
8469 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.
8470 This option is mostly useful for debugging, as GCC detects the capabilities of the assembler when it is built and sets the default accordingly.
8475 .Fl mexplicit-relocs
8476 is in effect, static data is accessed via
8481 is used, objects 8 bytes long or smaller are placed in a
8487 sections) and are accessed via 16-bit relocations off of the
8490 This limits the size of the small data area to 64KB, but allows the variables to be directly accessed via a single instruction.
8494 With this option the data area is limited to just below 2GB.
8495 Programs that require more than 2GB of data must use
8499 to allocate the data in the heap instead of in the program's data segment.
8501 When generating code for shared libraries,
8514 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.
8517 is used, the compiler can assume that all local symbols share the same
8519 value, and thus reduce the number of instructions required for a function call from 4 to 1.
8524 .It Fl mcpu= Ns Ar cpu_type
8525 Set the instruction set and instruction scheduling parameters for machine type
8527 You can specify either the
8529 style name or the corresponding chip number.
8530 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.
8531 If you do not specify a processor type, GCC will default to the processor on which the compiler was built.
8533 Supported values for
8541 Schedules as an EV4 and has no instruction set extensions.
8545 Schedules as an EV5 and has no instruction set extensions.
8549 Schedules as an EV5 and supports the BWX extension.
8554 Schedules as an EV5 and supports the BWX and MAX extensions.
8558 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
8562 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
8565 .It Fl mtune= Ns Ar cpu_type
8566 Set only the instruction scheduling parameters for machine type
8568 The instruction set is not changed.
8570 .It Fl mmemory-latency= Ns Ar time
8571 Sets the latency the scheduler should assume for typical memory references as seen by the application.
8572 This number is highly dependent on the memory access patterns used by the application and the size of the external cache on the machine.
8580 A decimal number representing clock cycles.
8586 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.
8587 Note that L3 is only valid for EV5.
8591 .It Sy DEC Alpha/VMS Options
8594 options are defined for the DEC Alpha/VMS implementations:
8597 .It Fl mvms-return-codes
8598 Return VMS condition codes from main.
8599 The default is to return POSIX style condition (e.g. error) codes.
8605 Only use the first 32 general purpose registers.
8608 Use all 64 general purpose registers.
8611 Use only the first 32 floating point registers.
8614 Use all 64 floating point registers
8617 Use hardware instructions for floating point operations.
8620 Use library routines for floating point operations.
8623 Dynamically allocate condition code registers.
8626 Do not try to dynamically allocate condition code registers, only use
8632 Change ABI to use double word insns.
8635 Do not use double word instructions.
8638 Use floating point double instructions.
8641 Do not use floating point double instructions.
8644 Use media instructions.
8647 Do not use media instructions.
8650 Use multiply and add/subtract instructions.
8653 Do not use multiply and add/subtract instructions.
8656 Select the FDPIC ABI, that uses function descriptors to represent pointers to functions.
8657 Without any PIC/PIE-related options, it implies
8663 it assumes GOT entries and small data are within a 12-bit range from the GOT base address; with
8667 GOT offsets are computed with 32 bits.
8670 Enable inlining of PLT entries in function calls to functions that are not known to bind locally.
8671 It has no effect without
8673 It's enabled by default if optimizing for speed and compiling for shared libraries (i.e.,
8677 or when an optimization option such as
8679 or above is present in the command line.
8682 Assume a large TLS segment when generating thread-local code.
8685 Do not assume a large TLS segment when generating thread-local code.
8690 relocations in the FDPIC ABI for data that is known to be in read-only sections.
8691 It's enabled by default, except for
8695 even though it may help make the global offset table smaller, it trades 1 instruction for 4.
8700 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.
8703 can be used to disable it.
8705 .It Fl multilib-library-pic
8706 Link with the (library, not FD) pic libraries.
8715 You should never have to use it explicitly.
8718 Follow the EABI requirement of always creating a frame pointer whenever a stack frame is allocated.
8719 This option is enabled by default and can be disabled with
8723 Use indirect addressing to call functions outside the current compilation unit.
8724 This allows the functions to be placed anywhere within the 32-bit address space.
8726 .It Fl malign-labels
8727 Try to align labels to an 8-byte boundary by inserting nops into the previous packet.
8728 This option only has an effect when VLIW packing is enabled.
8729 It doesn't create new packets; it merely adds nops to existing ones.
8732 Generate position-independent EABI code.
8735 Use only the first four media accumulator registers.
8738 Use all eight media accumulator registers.
8741 Pack VLIW instructions.
8744 Do not pack VLIW instructions.
8747 Do not mark ABI switches in e_flags.
8750 Enable the use of conditional-move instructions (default).
8752 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8754 .It Fl mno-cond-move
8755 Disable the use of conditional-move instructions.
8757 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8760 Enable the use of conditional set instructions (default).
8762 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8765 Disable the use of conditional set instructions.
8767 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8770 Enable the use of conditional execution (default).
8772 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8774 .It Fl mno-cond-exec
8775 Disable the use of conditional execution.
8777 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8780 Run a pass to pack branches into VLIW instructions (default).
8782 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8784 .It Fl mno-vliw-branch
8785 Do not run a pass to pack branches into VLIW instructions.
8787 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8789 .It Fl mmulti-cond-exec
8790 Enable optimization of
8794 in conditional execution (default).
8796 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8798 .It Fl mno-multi-cond-exec
8799 Disable optimization of
8803 in conditional execution.
8805 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8807 .It Fl mnested-cond-exec
8808 Enable nested conditional execution optimizations (default).
8810 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8812 .It Fl mno-nested-cond-exec
8813 Disable nested conditional execution optimizations.
8815 This switch is mainly for debugging the compiler and will likely be removed in a future version.
8817 .It Fl moptimize-membar
8818 This switch removes redundant
8820 instructions from the compiler generated code.
8821 It is enabled by default.
8823 .It Fl mno-optimize-membar
8824 This switch disables the automatic removal of redundant
8826 instructions from the generated code.
8828 .It Fl mtomcat-stats
8829 Cause gas to print out tomcat statistics.
8831 .It Fl mcpu= Ns Ar cpu
8832 Select the processor type for which to generate code.
8846 .It Sy H8/300 Options
8849 options are defined for the H8/300 implementations:
8853 Shorten some address references at link time, when possible; uses the linker option
8857 Generate code for the H8/300H.
8860 Generate code for the H8S.
8863 Generate code for the H8S and H8/300H in the normal mode.
8864 This switch must be used either with
8870 Generate code for the H8S/2600.
8871 This switch must be used with
8877 data 32 bits by default.
8880 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
8881 The default for the H8/300H and H8S is to align longs and floats on 4 byte boundaries.
8883 causes them to be aligned on 2 byte boundaries.
8884 This option has no effect on the H8/300.
8890 options are defined for the HPPA family of computers:
8893 .It Fl march= Ns Ar architecture-type
8894 Generate code for the specified architecture.
8896 .Em architecture-type
8903 for PA 2.0 processors.
8905 .Pa /usr/lib/sched.models
8906 on an HP-UX system to determine the proper architecture option for your machine.
8907 Code compiled for lower numbered architectures will run on higher numbered architectures, but not the other way around.
8920 Generate code suitable for big switch tables.
8921 Use this option only if the assembler/linker complain about out of range branches within a switch table.
8923 .It Fl mjump-in-delay
8924 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.
8926 .It Fl mdisable-fpregs
8927 Prevent floating point registers from being used in any manner.
8928 This is necessary for compiling kernels which perform lazy context switching of floating point registers.
8929 If you use this option and attempt to perform floating point operations, the compiler will abort.
8931 .It Fl mdisable-indexing
8932 Prevent the compiler from using indexing address modes.
8933 This avoids some rather obscure problems when compiling MIG generated code under MACH.
8935 .It Fl mno-space-regs
8936 Generate code that assumes the target has no space registers.
8937 This allows GCC to generate faster indirect calls and use unscaled index address modes.
8939 Such code is suitable for level 0 PA systems and kernels.
8941 .It Fl mfast-indirect-calls
8942 Generate code that assumes calls never cross space boundaries.
8943 This allows GCC to emit code which performs faster indirect calls.
8945 This option will not work in the presence of shared libraries or nested functions.
8947 .It Fl mfixed-range= Ns Ar register-range
8948 Generate code treating the given register range as fixed registers.
8949 A fixed register is one that the register allocator can not use.
8950 This is useful when compiling kernel code.
8951 A register range is specified as two registers separated by a dash.
8952 Multiple register ranges can be specified separated by a comma.
8954 .It Fl mlong-load-store
8955 Generate 3-instruction load and store sequences as sometimes required by the HP-UX 10 linker.
8956 This is equivalent to the
8958 option to the HP compilers.
8960 .It Fl mportable-runtime
8961 Use the portable calling conventions proposed by HP for ELF systems.
8964 Enable the use of assembler directives only GAS understands.
8966 .It Fl mschedule= Ns Ar cpu-type
8967 Schedule code according to the constraints for the machine type
8980 .Pa /usr/lib/sched.models
8981 on an HP-UX system to determine the proper scheduling option for your machine.
8982 The default scheduling is
8986 Enable the optimization pass in the HP-UX linker.
8987 Note this makes symbolic debugging impossible.
8988 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.
8991 Generate output containing library calls for floating point.
8993 the requisite libraries are not available for all HPPA targets.
8994 Normally the facilities of the machine's usual C compiler are used, but this cannot be done directly in cross-compilation.
8995 You must make your own arrangements to provide suitable library functions for cross-compilation.
8998 does provide software floating point support.
9001 changes the calling convention in the output file; therefore, it is only useful if you compile
9003 of a program with this option.
9004 In particular, you need to compile
9006 the library that comes with GCC, with
9008 in order for this to work.
9011 Generate the predefine,
9016 This generates the predefines,
9022 These options are available under HP-UX and HI-UX.
9025 Use GNU ld specific options.
9028 to ld when building a shared library.
9029 It is the default when GCC is configured, explicitly or implicitly, with the GNU linker.
9030 This option does not have any affect on which ld is called, it only changes what parameters are passed to that ld.
9031 The ld that is called is determined by the
9033 configure option, GCC's program search path, and finally by the user's
9035 The linker used by GCC can be printed using
9036 .Sy which `gcc -print-prog-name=ld` .
9037 This option is only available on the 64 bit HP-UX GCC, i.e. configured with
9038 .Sy hppa*64*-*-hpux* .
9041 Use HP ld specific options.
9044 to ld when building a shared library and passes
9045 .Sy +Accept TypeMismatch
9047 It is the default when GCC is configured, explicitly or implicitly, with the HP linker.
9048 This option does not have any affect on which ld is called, it only changes what parameters are passed to that ld.
9049 The ld that is called is determined by the
9051 configure option, GCC's program search path, and finally by the user's
9053 The linker used by GCC can be printed using
9054 .Sy which `gcc -print-prog-name=ld` .
9055 This option is only available on the 64 bit HP-UX GCC, i.e. configured with
9056 .Sy hppa*64*-*-hpux* .
9059 Generate code that uses long call sequences.
9060 This ensures that a call is always able to reach linker generated stubs.
9061 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.
9062 The limits for normal calls are 7,600,000 and 240,000 bytes, respectively for the PA 2.0 and PA 1.X architectures.
9063 Sibcalls are always limited at 240,000 bytes.
9065 Distances are measured from the beginning of functions when using the
9066 .Fl ffunction-sections
9067 option, or when using the
9070 .Fl mno-portable-runtime
9071 options together under HP-UX with the SOM linker.
9073 It is normally not desirable to use this option as it will degrade performance.
9074 However, it may be useful in large applications, particularly when partial linking is used to build the application.
9076 The types of long calls used depends on the capabilities of the assembler and linker, and the type of code being generated.
9077 The impact on systems that support long absolute calls, and long pic symbol-difference or pc-relative calls should be relatively small.
9078 However, an indirect call is used on 32-bit ELF systems in pic code and it is quite long.
9080 .It Fl munix= Ns Ar unix-std
9081 Generate compiler predefines and select a startfile for the specified UNIX standard.
9090 is supported on all HP-UX versions.
9092 is available on HP-UX 10.10 and later.
9094 is available on HP-UX 11.11 and later.
9095 The default values are
9099 for HP-UX 10.10 though to 11.00, and
9101 for HP-UX 11.11 and later.
9104 provides the same predefines as GCC 3.3 and 3.4.
9106 provides additional predefines for
9109 .Va _XOPEN_SOURCE_EXTENDED ,
9113 provides additional predefines for
9115 .Va _XOPEN_SOURCE_EXTENDED ,
9116 .Va _INCLUDE__STDC_A1_SOURCE
9118 .Va _INCLUDE_XOPEN_SOURCE_500 ,
9124 to note that this option changes the interfaces for various library routines.
9125 It also affects the operational behavior of the C library.
9128 care is needed in using this option.
9130 Library code that is intended to operate with more than one UNIX standard must test, set and restore the variable
9131 .Em __xpg4_extended_mask
9133 Most GNU software doesn't provide this capability.
9136 Suppress the generation of link options to search libdld.sl when the
9138 option is specified on HP-UX 10 and later.
9141 The HP-UX implementation of setlocale in libc has a dependency on libdld.sl.
9142 There isn't an archive version of libdld.sl.
9145 option is specified, special link options are needed to resolve this dependency.
9147 On HP-UX 10 and later, the GCC driver adds the necessary options to link with libdld.sl when the
9149 option is specified.
9150 This causes the resulting binary to be dynamic.
9151 On the 64-bit port, the linkers generate dynamic binaries by default in any case.
9154 option can be used to prevent the GCC driver from adding these link options.
9157 Add support for multithreading with the
9159 library under HP-UX.
9160 This option sets flags for both the preprocessor and linker.
9163 .It Sy Intel 386 and AMD x86-64 Options
9166 options are defined for the i386 and x86-64 family of computers:
9169 .It Fl mtune= Ns Ar cpu-type
9172 everything applicable about the generated code, except for the ABI and the set of available instructions.
9179 Original Intel's i386 CPU.
9183 (No scheduling is implemented for this chip.)
9185 .It Sy i586, pentium
9186 Intel Pentium CPU with no MMX support.
9189 Intel PentiumMMX CPU based on Pentium core with MMX instruction set support.
9191 .It Sy i686, pentiumpro
9192 Intel PentiumPro CPU.
9195 Intel Pentium2 CPU based on PentiumPro core with MMX instruction set support.
9197 .It Sy pentium3, pentium3m
9198 Intel Pentium3 CPU based on PentiumPro core with MMX and SSE instruction set support.
9201 Low power version of Intel Pentium3 CPU with MMX, SSE and SSE2 instruction set support.
9202 Used by Centrino notebooks.
9204 .It Sy pentium4, pentium4m
9205 Intel Pentium4 CPU with MMX, SSE and SSE2 instruction set support.
9208 Improved version of Intel Pentium4 CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
9211 Improved version of Intel Pentium4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 instruction set support.
9214 AMD K6 CPU with MMX instruction set support.
9217 Improved versions of AMD K6 CPU with MMX and 3dNOW! instruction set support.
9219 .It Sy athlon, athlon-tbird
9220 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions support.
9222 .It Sy athlon-4, athlon-xp, athlon-mp
9223 Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE instruction set support.
9225 .It Sy k8, opteron, athlon64, athlon-fx
9226 AMD K8 core based CPUs with x86-64 instruction set support.
9227 (This supersets MMX, SSE, SSE2, 3dNOW!, enhanced 3dNOW! and 64-bit instruction set extensions.)
9230 IDT Winchip C6 CPU, dealt in same way as i486 with additional MMX instruction set support.
9233 IDT Winchip2 CPU, dealt in same way as i486 with additional MMX and 3dNOW! instruction set support.
9236 Via C3 CPU with MMX and 3dNOW! instruction set support.
9237 (No scheduling is implemented for this chip.)
9240 Via C3-2 CPU with MMX and SSE instruction set support.
9241 (No scheduling is implemented for this chip.)
9244 While picking a specific
9246 will schedule things appropriately for that particular chip, the compiler will not generate any code that does not run on the i386 without the
9247 .Fl march= Ns Ar cpu-type
9250 .It Fl march= Ns Ar cpu-type
9251 Generate instructions for the machine type
9257 Moreover, specifying
9258 .Fl march= Ns Ar cpu-type
9260 .Fl mtune= Ns Ar cpu-type .
9262 .It Fl mcpu= Ns Ar cpu-type
9263 A deprecated synonym for
9270 These options are synonyms for
9275 .Fl mtune=pentiumpro
9277 These synonyms are deprecated.
9279 .It Fl mfpmath= Ns Ar unit
9280 Generate floating point arithmetics for selected unit
9288 Use the standard 387 floating point coprocessor present majority of chips and emulated otherwise.
9289 Code compiled with this option will run almost everywhere.
9290 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.
9293 for more detailed description.
9295 This is the default choice for i386 compiler.
9298 Use scalar floating point instructions present in the SSE instruction set.
9299 This instruction set is supported by Pentium3 and newer chips, in the AMD line by Athlon-4, Athlon-xp and Athlon-mp chips.
9300 The earlier version of SSE instruction set supports only single precision arithmetics, thus the double and extended precision arithmetics is still done using 387.
9301 Later version, present only in Pentium4 and the future AMD x86-64 chips supports double precision arithmetics too.
9303 For the i386 compiler, you need to use
9304 .Fl march= Ns Ar cpu-type ,
9308 switches to enable SSE extensions and make this option effective.
9309 For the x86-64 compiler, these extensions are enabled by default.
9311 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.
9313 This is the default choice for the x86-64 compiler.
9316 Attempt to utilize both instruction sets at once.
9317 This effectively double the amount of available registers and on chips with separate execution units for 387 and SSE the execution resources too.
9318 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.
9321 .It Fl masm= Ns Ar dialect
9322 Output asm instructions using selected
9324 Supported choices are
9329 Darwin does not support
9334 Control whether or not the compiler uses IEEE floating point comparisons.
9335 These handle correctly the case where the result of a comparison is unordered.
9338 Generate output containing library calls for floating point.
9340 the requisite libraries are not part of GCC.
9341 Normally the facilities of the machine's usual C compiler are used, but this can't be done directly in cross-compilation.
9342 You must make your own arrangements to provide suitable library functions for cross-compilation.
9344 On machines where a function returns floating point results in the 80387 register stack, some floating point opcodes may be emitted even if
9348 .It Fl mno-fp-ret-in-387
9349 Do not use the FPU registers for return values of functions.
9351 The usual calling convention has functions return values of types
9355 in an FPU register, even if there is no FPU.
9356 The idea is that the operating system should emulate an FPU.
9359 .Fl mno-fp-ret-in-387
9360 causes such values to be returned in ordinary CPU registers instead.
9362 .It Fl mno-fancy-math-387
9363 Some 387 emulators do not support the
9368 instructions for the 387.
9369 Specify this option to avoid generating those instructions.
9370 This option is the default on FreeBSD, OpenBSD and NetBSD.
9371 This option is overridden when
9373 indicates that the target cpu will always have an FPU and so the instruction will not need emulation.
9374 As of revision 2.6.1, these instructions are not generated unless you also use the
9375 .Fl funsafe-math-optimizations
9378 .It Fl malign-double
9379 .It Fl mno-align-double
9380 Control whether GCC aligns
9385 variables on a two word boundary or a one word boundary.
9388 variables on a two word boundary will produce code that runs somewhat faster on a
9390 at the expense of more memory.
9394 is enabled by default.
9399 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.
9401 .It Fl m96bit-long-double
9402 .It Fl m128bit-long-double
9403 These switches control the size of
9406 The i386 application binary interface specifies the size to be 96 bits, so
9407 .Fl m96bit-long-double
9408 is the default in 32 bit mode.
9410 Modern architectures (Pentium and newer) would prefer
9412 to be aligned to an 8 or 16 byte boundary.
9413 In arrays or structures conforming to the ABI, this would not be possible.
9415 .Fl m128bit-long-double
9418 to a 16 byte boundary by padding the
9420 with an additional 32 bit zero.
9422 In the x86-64 compiler,
9423 .Fl m128bit-long-double
9424 is the default choice as its ABI specifies that
9426 is to be aligned on 16 byte boundary.
9428 Notice that neither of these options enable any extra precision over the x87 standard of 80 bits for a
9432 if you override the default value for your target ABI, the structures and arrays containing
9434 variables will change their size as well as function calling convention for function taking
9437 Hence they will not be binary compatible with arrays or structures in code compiled without that switch.
9439 .It Fl mmlarge-data-threshold= Ns Ar number
9442 is specified, the data greater than
9444 are placed in large data section.
9445 This value must be the same across all object linked into the binary and defaults to 65535.
9448 .It Fl mno-svr3-shlib
9449 Control whether GCC places uninitialized local variables into the
9457 These options are meaningful only on System V Release 3.
9460 Use a different function-calling convention, in which functions that take a fixed number of arguments return with the
9463 instruction, which pops their arguments while returning.
9464 This saves one instruction in the caller since there is no need to pop the arguments there.
9466 You can specify that an individual function is called with this calling sequence with the function attribute
9468 You can also override the
9470 option by using the function attribute
9474 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.
9476 Also, you must provide function prototypes for all functions that take variable numbers of arguments (including
9478 otherwise incorrect code will be generated for calls to those functions.
9480 In addition, seriously incorrect code will result if you call a function with too many arguments.
9481 (Normally, extra arguments are harmlessly ignored.)
9483 .It Fl mregparm= Ns Ar num
9484 Control how many registers are used to pass integer arguments.
9485 By default, no registers are used to pass arguments, and at most 3 registers can be used.
9486 You can control this behavior for a specific function by using the function attribute
9490 if you use this switch, and
9492 is nonzero, then you must build all modules with the same value, including any libraries.
9493 This includes the system libraries and startup modules.
9496 Use SSE register passing conventions for float and double arguments and return values.
9497 You can control this behavior for a specific function by using the function attribute
9501 if you use this switch then you must build all modules with the same value, including any libraries.
9502 This includes the system libraries and startup modules.
9504 .It Fl mpreferred-stack-boundary= Ns Ar num
9505 Attempt to keep the stack boundary aligned to a 2 raised to
9509 .Fl mpreferred-stack-boundary
9510 is not specified, the default is 4 (16 bytes or 128 bits).
9512 On Pentium and PentiumPro,
9516 values should be aligned to an 8 byte boundary (see
9518 or suffer significant run time performance penalties.
9519 On Pentium III, the Streaming SIMD Extension (SSE) data type
9521 may not work properly if it is not 16 byte aligned.
9523 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.
9524 Further, every function must be generated such that it keeps the stack aligned.
9525 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.
9526 It is recommended that libraries that use callbacks always use the default setting.
9528 This extra alignment does consume extra stack space, and generally increases code size.
9529 Code that is sensitive to stack space usage, such as embedded systems and operating system kernels, may want to reduce the preferred alignment to
9530 .Fl mpreferred-stack-boundary=2 .
9542 These switches enable or disable the use of instructions in the MMX, SSE, SSE2 or 3DNow! extended instruction sets.
9543 These extensions are also available as built-in functions: see
9544 .Sy X86 Built-in Functions ,
9545 for details of the functions enabled and disabled by these switches.
9547 To have SSE/SSE2 instructions generated automatically from floating-point code (as opposed to 387 instructions), see
9550 These options will enable GCC to use these extended instructions in generated code, even without
9552 Applications which perform runtime CPU detection must compile separate files for each supported architecture, using the appropriate flags.
9553 In particular, the file containing the CPU detection code should be compiled without these options.
9556 .It Fl mno-push-args
9557 Use PUSH operations to store outgoing parameters.
9558 This method is shorter and usually equally fast as method using SUB/MOV operations and is enabled by default.
9559 In some cases disabling it may improve performance because of improved scheduling and reduced dependencies.
9561 .It Fl maccumulate-outgoing-args
9562 If enabled, the maximum amount of space required for outgoing arguments will be computed in the function prologue.
9563 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.
9564 The drawback is a notable increase in code size.
9569 Support thread-safe exception handling on
9571 Code that relies on thread-safe exception handling must compile and link all code with the
9578 when linking, it links in a special thread helper library
9580 which cleans up per thread exception handling data.
9582 .It Fl mno-align-stringops
9583 Do not align destination of inlined string operations.
9584 This switch reduces code size and improves performance in case the destination is already aligned, but GCC doesn't know about it.
9586 .It Fl minline-all-stringops
9587 By default GCC inlines string operations only when destination is known to be aligned at least to 4 byte boundary.
9588 This enables more inlining, increase code size, but may improve performance of code that depends on fast memcpy, strlen and memset for short lengths.
9590 .It Fl momit-leaf-frame-pointer
9591 Don't keep the frame pointer in a register for leaf functions.
9592 This avoids the instructions to save, set up and restore frame pointers and makes an extra register available in leaf functions.
9594 .Fl fomit-frame-pointer
9595 removes the frame pointer for all functions which might make debugging harder.
9597 .It Fl mtls-direct-seg-refs
9598 .It Fl mno-tls-direct-seg-refs
9599 Controls whether TLS variables may be accessed with offsets from the TLS segment register
9603 for 64-bit), or whether the thread base pointer must be added.
9604 Whether or not this is legal depends on the operating system, and whether it maps the segment to cover the entire TLS area.
9606 For systems that use GNU libc, the default is on.
9611 switches are supported in addition to the above on AMD x86-64 processors in 64-bit environments.
9616 Generate code for a 32-bit or 64-bit environment.
9617 The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any i386 system.
9618 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.
9621 Do not use a so called red zone for x86-64 code.
9622 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.
9625 disables this red zone.
9627 .It Fl mcmodel=small
9628 Generate code for the small code model: the program and its symbols must be linked in the lower 2 GB of the address space.
9629 Pointers are 64 bits.
9630 Programs can be statically or dynamically linked.
9631 This is the default code model.
9633 .It Fl mcmodel=kernel
9634 Generate code for the kernel code model.
9635 The kernel runs in the negative 2 GB of the address space.
9636 This model has to be used for Linux kernel code.
9638 .It Fl mcmodel=medium
9639 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.
9640 Programs can be statically or dynamically linked, but building of shared libraries are not supported with the medium model.
9642 .It Fl mcmodel=large
9643 Generate code for the large model: This model makes no assumptions about addresses and sizes of sections.
9644 Currently GCC does not implement this model.
9647 .It Sy IA-64 Options
9650 options defined for the Intel IA-64 architecture.
9654 Generate code for a big endian target.
9655 This is the default for HP-UX.
9657 .It Fl mlittle-endian
9658 Generate code for a little endian target.
9659 This is the default for AIX5 and GNU/Linux.
9663 Generate (or don't) code for the GNU assembler.
9664 This is the default.
9668 Generate (or don't) code for the GNU linker.
9669 This is the default.
9672 Generate code that does not use a global pointer register.
9673 The result is not position independent code, and violates the IA-64 ABI.
9675 .It Fl mvolatile-asm-stop
9676 .It Fl mno-volatile-asm-stop
9677 Generate (or don't) a stop bit immediately before and after volatile asm statements.
9679 .It Fl mregister-names
9680 .It Fl mno-register-names
9686 register names for the stacked registers.
9687 This may make assembler output more readable.
9691 Disable (or enable) optimizations that use the small data section.
9692 This may be useful for working around optimizer bugs.
9695 Generate code that uses a single constant global pointer value.
9696 This is useful when compiling kernel code.
9699 Generate code that is self-relocatable.
9702 This is useful when compiling firmware code.
9704 .It Fl minline-float-divide-min-latency
9705 Generate code for inline divides of floating point values using the minimum latency algorithm.
9707 .It Fl minline-float-divide-max-throughput
9708 Generate code for inline divides of floating point values using the maximum throughput algorithm.
9710 .It Fl minline-int-divide-min-latency
9711 Generate code for inline divides of integer values using the minimum latency algorithm.
9713 .It Fl minline-int-divide-max-throughput
9714 Generate code for inline divides of integer values using the maximum throughput algorithm.
9716 .It Fl minline-sqrt-min-latency
9717 Generate code for inline square roots using the minimum latency algorithm.
9719 .It Fl minline-sqrt-max-throughput
9720 Generate code for inline square roots using the maximum throughput algorithm.
9722 .It Fl mno-dwarf2-asm
9724 Don't (or do) generate assembler code for the DWARF2 line number debugging info.
9725 This may be useful when not using the GNU assembler.
9727 .It Fl mearly-stop-bits
9728 .It Fl mno-early-stop-bits
9729 Allow stop bits to be placed earlier than immediately preceding the instruction that triggered the stop bit.
9730 This can improve instruction scheduling, but does not always do so.
9732 .It Fl mfixed-range= Ns Ar register-range
9733 Generate code treating the given register range as fixed registers.
9734 A fixed register is one that the register allocator can not use.
9735 This is useful when compiling kernel code.
9736 A register range is specified as two registers separated by a dash.
9737 Multiple register ranges can be specified separated by a comma.
9739 .It Fl mtls-size= Ns Ar tls-size
9740 Specify bit size of immediate TLS offsets.
9741 Valid values are 14, 22, and 64.
9743 .It Fl mtune= Ns Ar cpu-type
9744 Tune the instruction scheduling for a particular CPU, Valid values are itanium, itanium1, merced, itanium2, and mckinley.
9748 Add support for multithreading using the POSIX threads library.
9749 This option sets flags for both the preprocessor and linker.
9750 It does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it.
9751 These are HP-UX specific flags.
9755 Generate code for a 32-bit or 64-bit environment.
9756 The 32-bit environment sets int, long and pointer to 32 bits.
9757 The 64-bit environment sets int to 32 bits and long and pointer to 64 bits.
9758 These are HP-UX specific flags.
9763 .It Fl mcpu= Ns Ar name
9764 Select the CPU for which code is generated.
9768 for the R8C/Tiny series,
9770 for the M16C (up to /60) series,
9772 for the M16C/80 series, or
9774 for the M32C/80 series.
9777 Specifies that the program will be run on the simulator.
9778 This causes an alternate runtime library to be linked in which supports, for example, file I/O.
9779 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.
9781 .It Fl memregs= Ns Ar number
9782 Specifies the number of memory-based pseudo-registers GCC will use during code generation.
9783 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.
9784 Note that all modules in a program must be compiled with the same value for this option.
9785 Because of that, you must not use this option with the default runtime libraries gcc builds.
9788 .It Sy M32R/D Options
9791 options are defined for Renesas M32R/D architectures:
9795 Generate code for the M32R/2.
9798 Generate code for the M32R/X.
9801 Generate code for the M32R.
9802 This is the default.
9805 Assume all objects live in the lower 16MB of memory (so that their addresses can be loaded with the
9807 instruction), and assume all subroutines are reachable with the
9810 This is the default.
9812 The addressability of a particular object can be set with the
9816 .It Fl mmodel=medium
9817 Assume objects may be anywhere in the 32-bit address space (the compiler will generate
9819 instructions to load their addresses), and assume all subroutines are reachable with the
9824 Assume objects may be anywhere in the 32-bit address space (the compiler will generate
9826 instructions to load their addresses), and assume subroutines may not be reachable with the
9828 instruction (the compiler will generate the much slower
9830 instruction sequence).
9833 Disable use of the small data area.
9834 Variables will be put into one of
9841 attribute has been specified).
9842 This is the default.
9844 The small data area consists of sections
9848 Objects may be explicitly put in the small data area with the
9850 attribute using one of these sections.
9853 Put small global and static data in the small data area, but do not generate special code to reference them.
9856 Put small global and static data in the small data area, and generate special instructions to reference them.
9859 Put global and static objects less than or equal to
9861 bytes into the small data or bss sections instead of the normal data or bss sections.
9862 The default value of
9867 option must be set to one of
9871 for this option to have any effect.
9873 All modules should be compiled with the same
9876 Compiling with different values of
9878 may or may not work; if it doesn't the linker will give an error message---incorrect code will not be generated.
9881 Makes the M32R specific code in the compiler display some statistics that might help in debugging programs.
9884 Align all loops to a 32-byte boundary.
9886 .It Fl mno-align-loops
9887 Do not enforce a 32-byte alignment for loops.
9888 This is the default.
9890 .It Fl missue-rate= Ns Ar number
9893 instructions per cycle.
9897 .It Fl mbranch-cost= Ns Ar number
9900 If it is 1 then branches will be preferred over conditional code, if it is 2, then the opposite will apply.
9902 .It Fl mflush-trap= Ns Ar number
9903 Specifies the trap number to use to flush the cache.
9905 Valid numbers are between 0 and 15 inclusive.
9907 .It Fl mno-flush-trap
9908 Specifies that the cache cannot be flushed by using a trap.
9910 .It Fl mflush-func= Ns Ar name
9911 Specifies the name of the operating system function to call to flush the cache.
9914 but a function call will only be used if a trap is not available.
9916 .It Fl mno-flush-func
9917 Indicates that there is no OS function for flushing the cache.
9920 .It Sy M680x0 Options
9923 options defined for the 68000 series.
9924 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.
9929 Generate output for a 68000.
9930 This is the default when the compiler is configured for 68000-based systems.
9932 Use this option for microcontrollers with a 68000 or EC000 core, including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
9936 Generate output for a 68020.
9937 This is the default when the compiler is configured for 68020-based systems.
9940 Generate output containing 68881 instructions for floating point.
9941 This is the default for most 68020 systems unless
9943 was specified when the compiler was configured.
9946 Generate output for a 68030.
9947 This is the default when the compiler is configured for 68030-based systems.
9950 Generate output for a 68040.
9951 This is the default when the compiler is configured for 68040-based systems.
9953 This option inhibits the use of 68881/68882 instructions that have to be emulated by software on the 68040.
9954 Use this option if your 68040 does not have code to emulate those instructions.
9957 Generate output for a 68060.
9958 This is the default when the compiler is configured for 68060-based systems.
9960 This option inhibits the use of 68020 and 68881/68882 instructions that have to be emulated by software on the 68060.
9961 Use this option if your 68060 does not have code to emulate those instructions.
9964 Generate output for a CPU32.
9965 This is the default when the compiler is configured for CPU32-based systems.
9967 Use this option for microcontrollers with a CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334, 68336, 68340, 68341, 68349 and 68360.
9970 Generate output for a 520X "coldfire" family cpu.
9971 This is the default when the compiler is configured for 520X-based systems.
9973 Use this option for microcontroller with a 5200 core, including the MCF5202, MCF5203, MCF5204 and MCF5202.
9976 Generate output for a 68040, without using any of the new instructions.
9977 This results in code which can run relatively efficiently on either a 68020/68881 or a 68030 or a 68040.
9978 The generated code does use the 68881 instructions that are emulated on the 68040.
9981 Generate output for a 68060, without using any of the new instructions.
9982 This results in code which can run relatively efficiently on either a 68020/68881 or a 68030 or a 68040.
9983 The generated code does use the 68881 instructions that are emulated on the 68060.
9986 Generate output containing library calls for floating point.
9988 the requisite libraries are not available for all m68k targets.
9989 Normally the facilities of the machine's usual C compiler are used, but this can't be done directly in cross-compilation.
9990 You must make your own arrangements to provide suitable library functions for cross-compilation.
9991 The embedded targets
9995 do provide software floating point support.
10000 to be 16 bits wide, like
10002 Additionally, parameters passed on the stack are also aligned to a 16-bit boundary even on targets whose API mandates promotion to 32-bit.
10005 Do not use the bit-field instructions.
10015 Do use the bit-field instructions.
10020 This is the default if you use a configuration designed for a 68020.
10023 Use a different function-calling convention, in which functions that take a fixed number of arguments return with the
10025 instruction, which pops their arguments while returning.
10026 This saves one instruction in the caller since there is no need to pop the arguments there.
10028 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.
10030 Also, you must provide function prototypes for all functions that take variable numbers of arguments (including
10032 otherwise incorrect code will be generated for calls to those functions.
10034 In addition, seriously incorrect code will result if you call a function with too many arguments.
10035 (Normally, extra arguments are harmlessly ignored.)
10039 instruction is supported by the 68010, 68020, 68030, 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
10042 .It Fl mno-align-int
10043 Control whether GCC aligns
10051 variables on a 32-bit boundary
10053 or a 16-bit boundary
10054 .Fl ( mno-align-int ) .
10055 Aligning variables on 32-bit boundaries produces code that runs somewhat faster on processors with 32-bit busses at the expense of more memory.
10060 switch, GCC will align structures containing the above types differently than most published application binary interface specifications for the m68k.
10063 Use the pc-relative addressing mode of the 68000 directly, instead of using a global offset table.
10064 At present, this option implies
10066 allowing at most a 16-bit offset for pc-relative addressing.
10068 is not presently supported with
10070 though this could be supported for 68020 and higher processors.
10072 .It Fl mno-strict-align
10073 .It Fl mstrict-align
10074 Do not (do) assume that unaligned memory references will be handled by the system.
10077 Generate code that allows the data segment to be located in a different area of memory from the text segment.
10078 This allows for execute in place in an environment without virtual memory management.
10079 This option implies
10082 .It Fl mno-sep-data
10083 Generate code that assumes that the data segment follows the text segment.
10084 This is the default.
10086 .It Fl mid-shared-library
10087 Generate code that supports shared libraries via the library ID method.
10088 This allows for execute in place and shared libraries in an environment without virtual memory management.
10089 This option implies
10092 .It Fl mno-id-shared-library
10093 Generate code that doesn't assume ID based shared libraries are being used.
10094 This is the default.
10096 .It Fl mshared-library-id=n
10097 Specified the identification number of the ID based shared library being compiled.
10098 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.
10101 .It Sy M68hc1x Options
10104 options defined for the 68hc11 and 68hc12 microcontrollers.
10105 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.
10110 Generate output for a 68HC11.
10111 This is the default when the compiler is configured for 68HC11-based systems.
10115 Generate output for a 68HC12.
10116 This is the default when the compiler is configured for 68HC12-based systems.
10120 Generate output for a 68HCS12.
10122 .It Fl mauto-incdec
10123 Enable the use of 68HC12 pre and post auto-increment and auto-decrement addressing modes.
10127 Enable the use of 68HC12 min and max instructions.
10130 .It Fl mno-long-calls
10131 Treat all calls as being far away (near).
10132 If calls are assumed to be far away, the compiler will use the
10134 instruction to call a function and the
10136 instruction for returning.
10141 to be 16 bits wide, like
10144 .It Fl msoft-reg-count= Ns Ar count
10145 Specify the number of pseudo-soft registers which are used for the code generation.
10146 The maximum number is 32.
10147 Using more pseudo-soft register may or may not result in better code depending on the program.
10148 The default is 4 for 68HC11 and 2 for 68HC12.
10151 .It Sy MCore Options
10154 options defined for the Motorola M*Core processors.
10159 Inline constants into the code stream if it can be done in two instructions or less.
10163 Use the divide instruction.
10164 (Enabled by default).
10166 .It Fl mrelax-immediate
10167 .It Fl mno-relax-immediate
10168 Allow arbitrary sized immediates in bit operations.
10170 .It Fl mwide-bitfields
10171 .It Fl mno-wide-bitfields
10172 Always treat bit-fields as int-sized.
10174 .It Fl m4byte-functions
10175 .It Fl mno-4byte-functions
10176 Force all functions to be aligned to a four byte boundary.
10178 .It Fl mcallgraph-data
10179 .It Fl mno-callgraph-data
10180 Emit callgraph information.
10183 .It Fl mno-slow-bytes
10184 Prefer word access when reading byte quantities.
10186 .It Fl mlittle-endian
10188 Generate code for a little endian target.
10192 Generate code for the 210 processor.
10195 .It Sy MIPS Options
10198 Generate big-endian code.
10201 Generate little-endian code.
10202 This is the default for
10206 .It Fl march= Ns Ar arch
10207 Generate code that will run on
10209 which can be the name of a generic MIPS ISA, or the name of a particular processor.
10219 The processor names are:
10256 selects the most compatible architecture for the selected ABI (that is,
10258 for 32-bit ABIs and
10262 In processor names, a final
10264 can be abbreviated as
10268 Prefixes are optional, and
10273 GCC defines two macros based on the value of this option.
10276 which gives the name of target architecture, as a string.
10277 The second has the form
10282 is the capitalized value of
10290 and define the macro
10291 .Sy _MIPS_ARCH_R2000 .
10295 macro uses the processor names given above.
10296 In other words, it will have the full prefix and will not abbreviate
10302 the macro names the resolved architecture (either
10306 It names the default architecture when no
10310 .It Fl mtune= Ns Ar arch
10313 Among other things, this option controls the way instructions are scheduled, and the perceived cost of arithmetic operations.
10316 values is the same as for
10319 When this option is not used, GCC will optimize for the processor specified by
10325 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.
10333 which work in the same way as the
10335 ones described above.
10359 .Fl march=mips32r2 .
10367 Generate (do not generate) MIPS16 code.
10368 If GCC is targetting a MIPS32 or MIPS64 architecture, it will make use of the MIPS16e ASE.
10375 Generate code for the given ABI.
10377 Note that the EABI has a 32-bit and a 64-bit variant.
10378 GCC normally generates 64-bit code when you select a 64-bit architecture, but you can use
10380 to get 32-bit code instead.
10382 For information about the O64 ABI, see
10383 .Lk http://gcc.gnu.org/projects/mipso64-abi.html .
10386 .It Fl mno-abicalls
10387 Generate (do not generate) SVR4-style position-independent code.
10389 is the default for SVR4-based systems.
10393 Lift (do not lift) the usual restrictions on the size of the global offset table.
10395 GCC normally uses a single instruction to load values from the GOT.
10396 While this is relatively efficient, it will only work if the GOT is smaller than about 64k.
10397 Anything larger will cause the linker to report an error such as:
10399 .Bd -literal -offset indent
10400 relocation truncated to fit: R_MIPS_GOT16 foobar
10402 If this happens, you should recompile your code with
10404 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.
10406 Note that some linkers can create multiple GOTs.
10407 If you have such a linker, you should only need to use
10409 when a single object file accesses more than 64k's worth of GOT entries.
10412 These options have no effect unless GCC is generating position independent code.
10415 Assume that general-purpose registers are 32 bits wide.
10418 Assume that general-purpose registers are 64 bits wide.
10421 Assume that floating-point registers are 32 bits wide.
10424 Assume that floating-point registers are 64 bits wide.
10427 Use floating-point coprocessor instructions.
10430 Do not use floating-point coprocessor instructions.
10431 Implement floating-point calculations using library calls instead.
10433 .It Fl msingle-float
10434 Assume that the floating-point coprocessor only supports single-precision operations.
10436 .It Fl mdouble-float
10437 Assume that the floating-point coprocessor supports double-precision operations.
10438 This is the default.
10442 Use (do not use) the MIPS DSP ASE.
10444 .It Fl mpaired-single
10445 .It Fl mno-paired-single
10446 Use (do not use) paired-single floating-point instructions.
10447 This option can only be used when generating 64-bit code and requires hardware floating-point support to be enabled.
10451 Use (do not use) the MIPS-3D ASE.
10455 .Fl mpaired-single .
10460 types to be 64 bits wide.
10463 for an explanation of the default and the way that the pointer size is determined.
10469 and pointer types to be 32 bits wide.
10471 The default size of
10475 s and pointers depends on the ABI.
10476 All the supported ABIs use 32-bit
10479 The n64 ABI uses 64-bit
10481 s, as does the 64-bit EABI; the others use 32-bit
10484 Pointers are the same size as
10486 s, or the same size as integer registers, whichever is smaller.
10490 Assume (do not assume) that all symbols have 32-bit values, regardless of the selected ABI.
10491 This option is useful in combination with
10495 because it allows GCC to generate shorter and faster references to symbolic addresses.
10498 Put global and static items less than or equal to
10500 bytes into the small data or bss section instead of the normal data or bss section.
10501 This allows the data to be accessed using a single instruction.
10503 All modules should be compiled with the same
10507 .It Fl membedded-data
10508 .It Fl mno-embedded-data
10509 Allocate variables to the read-only data section first if possible, then next in the small data section if possible, otherwise in data.
10510 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.
10512 .It Fl muninit-const-in-rodata
10513 .It Fl mno-uninit-const-in-rodata
10516 variables in the read-only data section.
10517 This option is only meaningful in conjunction with
10518 .Fl membedded-data .
10520 .It Fl msplit-addresses
10521 .It Fl mno-split-addresses
10522 Enable (disable) use of the
10526 assembler relocation operators.
10527 This option has been superseded by
10528 .Fl mexplicit-relocs
10529 but is retained for backwards compatibility.
10531 .It Fl mexplicit-relocs
10532 .It Fl mno-explicit-relocs
10533 Use (do not use) assembler relocation operators when dealing with symbolic addresses.
10534 The alternative, selected by
10535 .Fl mno-explicit-relocs ,
10536 is to use assembler macros instead.
10538 .Fl mexplicit-relocs
10539 is the default if GCC was configured to use an assembler that supports relocation operators.
10541 .It Fl mcheck-zero-division
10542 .It Fl mno-check-zero-division
10543 Trap (do not trap) on integer division by zero.
10545 .Fl mcheck-zero-division .
10547 .It Fl mdivide-traps
10548 .It Fl mdivide-breaks
10549 MIPS systems check for division by zero by generating either a conditional trap or a break instruction.
10550 Using traps results in smaller code, but is only supported on MIPS II and later.
10551 Also, some versions of the Linux kernel have a bug that prevents trap from generating the proper signal
10555 to allow conditional traps on architectures that support them and
10557 to force the use of breaks.
10559 The default is usually
10560 .Fl mdivide-traps ,
10561 but this can be overridden at configure time using
10562 .Fl -with-divide=breaks .
10563 Divide-by-zero checks can be completely disabled using
10564 .Fl mno-check-zero-division .
10568 Force (do not force) the use of
10570 for non-trivial block moves.
10573 which allows GCC to inline most constant-sized copies.
10576 .It Fl mno-long-calls
10577 Disable (do not disable) use of the
10580 Calling functions using
10582 is more efficient but requires the caller and callee to be in the same 256 megabyte segment.
10584 This option has no effect on abicalls code.
10586 .Fl mno-long-calls .
10590 Enable (disable) use of the
10595 instructions, as provided by the R4650 ISA.
10598 .It Fl mno-fused-madd
10599 Enable (disable) use of the floating point multiply-accumulate instructions, when they are available.
10603 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.
10604 This may be undesirable in some circumstances.
10607 Tell the MIPS assembler to not run its preprocessor over user assembler files (with a
10609 suffix) when assembling them.
10612 .It Fl mno-fix-r4000
10613 Work around certain R4000 CPU errata:
10617 A double-word or a variable shift may give an incorrect result if executed immediately after starting an integer division.
10620 A double-word or a variable shift may give an incorrect result if executed while an integer multiplication is in progress.
10623 An integer division may give an incorrect result if started in a delay slot of a taken branch or a jump.
10627 .It Fl mno-fix-r4400
10628 Work around certain R4400 CPU errata:
10632 A double-word or a variable shift may give an incorrect result if executed immediately after starting an integer division.
10636 .It Fl mno-fix-vr4120
10637 Work around certain VR4120 errata:
10642 does not always produce the correct result.
10648 do not always produce the correct result if one of the operands is negative.
10651 The workarounds for the division errata rely on special functions in
10653 At present, these functions are only provided by the
10657 Other VR4120 errata require a nop to be inserted between certain pairs of instructions.
10658 These errata are handled by the assembler, not by GCC itself.
10661 Work around the VR4130
10666 The workarounds are implemented by the assembler rather than by GCC, although GCC will avoid using
10676 instructions are available instead.
10680 Work around certain SB-1 CPU core errata.
10681 (This flag currently works around the SB-1 revision 2 "F1" and "F2" floating point errata.)
10683 .It Fl mflush-func= Ns Ar func
10684 .It Fl mno-flush-func
10685 Specifies the function to call to flush the I and D caches, or to not call any such function.
10686 If called, the function must take the same arguments as the common
10687 .Va _flush_func() ,
10688 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).
10689 The default depends on the target GCC was configured for, but commonly is either
10694 .It Fl mbranch-likely
10695 .It Fl mno-branch-likely
10696 Enable or disable use of Branch Likely instructions, regardless of the default for the selected architecture.
10697 By default, Branch Likely instructions may be generated if they are supported by the selected architecture.
10698 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.
10700 .It Fl mfp-exceptions
10701 .It Fl mno-fp-exceptions
10702 Specifies whether FP exceptions are enabled.
10703 This affects how we schedule FP instructions for some processors.
10704 The default is that FP exceptions are enabled.
10706 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.
10707 Otherwise, we can only use one FP pipe.
10709 .It Fl mvr4130-align
10710 .It Fl mno-vr4130-align
10711 The VR4130 pipeline is two-way superscalar, but can only issue two instructions together if the first one is 8-byte aligned.
10712 When this option is enabled, GCC will align pairs of instructions that it thinks should execute in parallel.
10714 This option only has an effect when optimizing for the VR4130.
10715 It normally makes code faster, but at the expense of making it bigger.
10716 It is enabled by default at optimization level
10720 .It Sy MMIX Options
10721 These options are defined for the MMIX:
10725 .It Fl mno-libfuncs
10726 Specify that intrinsic library functions are being compiled, passing all values in registers, no matter the size.
10730 Generate floating-point comparison instructions that compare with respect to the
10734 .It Fl mabi=mmixware
10736 Generate code that passes function parameters and return values that (in the called function) are seen as registers
10738 and up, as opposed to the GNU ABI which uses global registers
10742 .It Fl mzero-extend
10743 .It Fl mno-zero-extend
10744 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.
10747 .It Fl mno-knuthdiv
10748 Make the result of a division yielding a remainder have the same sign as the divisor.
10751 the sign of the remainder follows the sign of the dividend.
10752 Both methods are arithmetically valid, the latter being almost exclusively used.
10754 .It Fl mtoplevel-symbols
10755 .It Fl mno-toplevel-symbols
10756 Prepend (do not prepend) a
10758 to all global symbols, so the assembly code can be used with the
10760 assembly directive.
10763 Generate an executable in the ELF format, rather than the default
10769 .It Fl mbranch-predict
10770 .It Fl mno-branch-predict
10771 Use (do not use) the probable-branch instructions, when static branch prediction indicates a probable branch.
10773 .It Fl mbase-addresses
10774 .It Fl mno-base-addresses
10775 Generate (do not generate) code that uses
10776 .Em base addresses .
10777 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.
10778 The register is used for one or more base address requests within the range 0 to 255 from the value held in the register.
10779 The generally leads to short and fast code, but the number of different data items that can be addressed is limited.
10780 This means that a program that uses lots of static data may require
10781 .Fl mno-base-addresses .
10783 .It Fl msingle-exit
10784 .It Fl mno-single-exit
10785 Force (do not force) generated code to have a single exit point in each function.
10788 .It Sy MN10300 Options
10791 options are defined for Matsushita MN10300 architectures:
10795 Generate code to avoid bugs in the multiply instructions for the MN10300 processors.
10796 This is the default.
10798 .It Fl mno-mult-bug
10799 Do not generate code to avoid bugs in the multiply instructions for the MN10300 processors.
10802 Generate code which uses features specific to the AM33 processor.
10805 Do not generate code which uses features specific to the AM33 processor.
10806 This is the default.
10808 .It Fl mreturn-pointer-on-d0
10809 When generating a function which returns a pointer, return the pointer in both
10813 Otherwise, the pointer is returned only in a0, and attempts to call such functions without a prototype would result in errors.
10814 Note that this option is on by default; use
10815 .Fl mno-return-pointer-on-d0
10819 Do not link in the C run-time initialization object file.
10822 Indicate to the linker that it should perform a relaxation optimization pass to shorten branches, calls and absolute memory addresses.
10823 This option only has an effect when used on the command line for the final link step.
10825 This option makes symbolic debugging impossible.
10831 options are defined for Morpho MT architectures:
10834 .It Fl march= Ns Ar cpu-type
10835 Generate code that will run on
10837 which is the name of a system representing a certain processor type.
10838 Possible values for
10847 When this option is not used, the default is
10848 .Fl march=ms1-16-002 .
10851 Use byte loads and stores when generating code.
10854 Do not use byte loads and stores when generating code.
10857 Use simulator runtime
10860 Do not link in the C run-time initialization object file
10862 Other run-time initialization and termination files such as
10866 are still included on the linker command line.
10869 .It Sy PDP-11 Options
10870 These options are defined for the PDP-11:
10874 Use hardware FPP floating point.
10875 This is the default.
10876 (FIS floating point on the PDP-11/40 is not supported.)
10879 Do not use hardware floating point.
10882 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
10885 Return floating-point results in memory.
10886 This is the default.
10889 Generate code for a PDP-11/40.
10892 Generate code for a PDP-11/45.
10893 This is the default.
10896 Generate code for a PDP-11/10.
10898 .It Fl mbcopy-builtin
10901 patterns for copying memory.
10902 This is the default.
10907 patterns for copying memory.
10913 This is the default.
10924 This is the default.
10935 This is the default.
10942 .It Fl mbranch-expensive
10943 Pretend that branches are expensive.
10944 This is for experimenting with code generation only.
10946 .It Fl mbranch-cheap
10947 Do not pretend that branches are expensive.
10948 This is the default.
10951 Generate code for a system with split I&D.
10954 Generate code for a system without split I&D.
10955 This is the default.
10958 Use Unix assembler syntax.
10959 This is the default when configured for
10963 Use DEC assembler syntax.
10964 This is the default when configured for any PDP-11 target other than
10968 .It Sy PowerPC Options
10969 These are listed under
10970 .It Sy IBM RS/6000 and PowerPC Options
10973 options are defined for the IBM RS/6000 and PowerPC:
10982 .It Fl mpowerpc-gpopt
10983 .It Fl mno-powerpc-gpopt
10984 .It Fl mpowerpc-gfxopt
10985 .It Fl mno-powerpc-gfxopt
10987 .It Fl mno-powerpc64
10994 GCC supports two related instruction set architectures for the RS/6000 and PowerPC.
10997 instruction set are those instructions supported by the
10999 chip set used in the original RS/6000 systems and the
11001 instruction set is the architecture of the Freescale MPC5xx, MPC6xx, MPC8xx microprocessors, and the IBM 4xx, 6xx, and follow-on microprocessors.
11003 Neither architecture is a subset of the other.
11004 However there is a large common subset of instructions supported by both.
11005 An MQ register is included in processors supporting the POWER architecture.
11007 You use these options to specify which instructions are available on the processor you are using.
11008 The default value of these options is determined when configuring GCC.
11010 .Fl mcpu= Ns Ar cpu_type
11011 overrides the specification of these options.
11012 We recommend you use the
11013 .Fl mcpu= Ns Ar cpu_type
11014 option rather than the options listed above.
11018 option allows GCC to generate instructions that are found only in the POWER architecture and to use the MQ register.
11023 and also allows GCC to generate instructions that are present in the POWER2 architecture but not the original POWER architecture.
11027 option allows GCC to generate instructions that are found only in the 32-bit subset of the PowerPC architecture.
11032 and also allows GCC to use the optional PowerPC architecture instructions in the General Purpose group, including floating-point square root.
11034 .Fl mpowerpc-gfxopt
11037 and also allows GCC to use the optional PowerPC architecture instructions in the Graphics group, including floating-point select.
11041 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.
11044 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.
11047 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.
11051 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.
11053 .Fl mno-powerpc64 .
11055 If you specify both
11059 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.
11064 permits GCC to use any instruction from either architecture and to allow use of the MQ register; specify this for the Motorola MPC601.
11066 .It Fl mnew-mnemonics
11067 .It Fl mold-mnemonics
11068 Select which mnemonics to use in the generated assembler code.
11070 .Fl mnew-mnemonics ,
11071 GCC uses the assembler mnemonics defined for the PowerPC architecture.
11074 it uses the assembler mnemonics defined for the POWER architecture.
11075 Instructions defined in only one architecture have only one mnemonic; GCC uses that mnemonic irrespective of which of these options is specified.
11077 GCC defaults to the mnemonics appropriate for the architecture in use.
11079 .Fl mcpu= Ns Ar cpu_type
11080 sometimes overrides the value of these option.
11081 Unless you are building a cross-compiler, you should normally not specify either
11084 .Fl mold-mnemonics ,
11085 but should instead accept the default.
11087 .It Fl mcpu= Ns Ar cpu_type
11088 Set architecture type, register usage, choice of mnemonics, and instruction scheduling parameters for machine type
11090 Supported values for
11140 selects a completely generic processor.
11141 Code generated under this option will run on any POWER or PowerPC processor.
11142 GCC will use only the instructions in the common subset of both architectures, and will not use the MQ register.
11143 GCC assumes a generic processor model for scheduling purposes.
11150 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.
11152 The other options specify a specific processor.
11153 Code generated under those options will run best on that processor, and may not run at all on others.
11157 options automatically enable or disable the following options:
11163 .Fl mnew-mnemonics ,
11168 .Fl mpowerpc-gpopt ,
11169 .Fl mpowerpc-gfxopt ,
11171 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.
11172 If you wish to set an individual option to a particular value, you may specify it after the
11175 .Fl mcpu=970 Fl mno-altivec .
11181 options are not enabled or disabled by the
11183 option at present because AIX does not have full support for these options.
11184 You may still enable or disable them individually if you're sure it'll work in your environment.
11186 .It Fl mtune= Ns Ar cpu_type
11187 Set the instruction scheduling parameters for machine type
11189 but do not set the architecture type, register usage, or choice of mnemonics, as
11190 .Fl mcpu= Ns Ar cpu_type
11192 The same values for
11198 If both are specified, the code generated will use the architecture, registers, and mnemonics set by
11200 but the scheduling parameters set by
11205 Generate code to compute division as reciprocal estimate and iterative refinement, creating opportunities for increased throughput.
11206 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.
11210 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.
11211 You may also need to set
11213 to adjust the current ABI with AltiVec ABI enhancements.
11217 Generate VRSAVE instructions when generating AltiVec code.
11220 Generate code that allows ld and ld.so to build executables and shared libraries with non-exec .plt and .got sections.
11221 This is a PowerPC 32-bit SYSV ABI option.
11224 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.
11225 This is a PowerPC 32-bit SYSV ABI option.
11229 This switch enables or disables the generation of ISEL instructions.
11231 .It Fl misel= Ns Ar yes/no
11232 This switch has been deprecated.
11241 This switch enables or disables the generation of SPE simd instructions.
11243 .It Fl mspe= Ns Ar yes/no
11244 This option has been deprecated.
11251 .It Fl mfloat-gprs= Ns Ar yes/single/double/no
11253 This switch enables or disables the generation of floating point operations on the general purpose registers for architectures that support it.
11259 enables the use of single-precision floating point operations.
11263 enables the use of single and double-precision floating point operations.
11267 disables floating point operations on the general purpose registers.
11269 This option is currently only available on the MPC854x.
11273 Generate code for 32-bit or 64-bit environments of Darwin and SVR4 targets (including GNU/Linux).
11274 The 32-bit environment sets int, long and pointer to 32 bits and generates code that runs on any PowerPC variant.
11275 The 64-bit environment sets int to 32 bits and long and pointer to 64 bits, and generates code for PowerPC64, as for
11279 .It Fl mno-fp-in-toc
11280 .It Fl mno-sum-in-toc
11281 .It Fl mminimal-toc
11282 Modify generation of the TOC (Table Of Contents), which is created for every executable file.
11285 option is selected by default.
11286 In that case, GCC will allocate at least one TOC entry for each unique non-automatic variable reference in your program.
11287 GCC will also place floating-point constants in the TOC.
11288 However, only 16,384 entries are available in the TOC.
11290 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
11296 prevents GCC from putting floating-point constants in the TOC and
11298 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.
11299 You may specify one or both of these options.
11300 Each causes GCC to produce very slightly slower and larger code at the expense of conserving TOC space.
11302 If you still run out of space in the TOC even when you specify both of these options, specify
11305 This option causes GCC to make only one TOC entry for every file.
11306 When you specify this option, GCC will produce code that is slower and larger but which uses extremely little TOC space.
11307 You may wish to use this option only on files that contain less frequently executed code.
11311 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
11313 type, and the infrastructure needed to support them.
11322 disables the 64-bit ABI and implies
11323 .Fl mno-powerpc64 .
11328 .It Fl mno-xl-compat
11329 Produce code that conforms more closely to IBM XL compiler semantics when using AIX-compatible ABI.
11330 Pass floating-point arguments to prototyped functions beyond the register save area (RSA) on the stack in addition to argument FPRs.
11331 Do not assume that most significant double in 128-bit long double value is properly rounded when comparing values and converting to double.
11332 Use XL symbol names for long double support routines.
11334 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.
11335 IBM XL compilers access floating point arguments which do not fit in the RSA from the stack when a subroutine is compiled without optimization.
11336 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.
11341 .Em Parallel Environment
11343 Link an application written to use message passing with special startup code to enable the application to run.
11344 The system must have PE installed in the standard location
11345 .Pa ( /usr/lpp/ppe.poe/ ) ,
11348 file must be overridden with the
11350 option to specify the appropriate directory location.
11351 The Parallel Environment does not support threads, so the
11355 option are incompatible.
11357 .It Fl malign-natural
11358 .It Fl malign-power
11359 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
11361 overrides the ABI-defined alignment of larger types, such as floating-point doubles, on their natural size-based boundary.
11364 instructs GCC to follow the ABI-specified alignment rules.
11365 GCC defaults to the standard alignment defined in the ABI.
11367 On 64-bit Darwin, natural alignment is the default, and
11373 Generate code that does not use (uses) the floating-point register set.
11374 Software floating point emulation is provided if you use the
11376 option, and pass the option to GCC when linking.
11379 .It Fl mno-multiple
11380 Generate code that uses (does not use) the load multiple word instructions and the store multiple word instructions.
11381 These instructions are generated by default on POWER systems, and not generated on PowerPC systems.
11384 on little endian PowerPC systems, since those instructions do not work when the processor is in little endian mode.
11385 The exceptions are PPC740 and PPC750 which permit the instructions usage in little endian mode.
11389 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.
11390 These instructions are generated by default on POWER systems, and not generated on PowerPC systems.
11393 on little endian PowerPC systems, since those instructions do not work when the processor is in little endian mode.
11394 The exceptions are PPC740 and PPC750 which permit the instructions usage in little endian mode.
11398 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.
11399 These instructions are generated by default.
11402 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.
11405 .It Fl mno-fused-madd
11406 Generate code that uses (does not use) the floating point multiply and accumulate instructions.
11407 These instructions are generated by default if hardware floating is used.
11409 .It Fl mno-bit-align
11411 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.
11413 For example, by default a structure containing nothing but 8
11415 bit-fields of length 1 would be aligned to a 4 byte boundary and have a size of 4 bytes.
11417 .Fl mno-bit-align ,
11418 the structure would be aligned to a 1 byte boundary and be one byte in size.
11420 .It Fl mno-strict-align
11421 .It Fl mstrict-align
11422 On System V.4 and embedded PowerPC systems do not (do) assume that unaligned memory references will be handled by the system.
11424 .It Fl mrelocatable
11425 .It Fl mno-relocatable
11426 On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime.
11429 on any module, all objects linked together must be compiled with
11432 .Fl mrelocatable-lib .
11434 .It Fl mrelocatable-lib
11435 .It Fl mno-relocatable-lib
11436 On embedded PowerPC systems generate code that allows (does not allow) the program to be relocated to a different address at runtime.
11437 Modules compiled with
11438 .Fl mrelocatable-lib
11439 can be linked with either modules compiled without
11442 .Fl mrelocatable-lib
11443 or with modules compiled with the
11449 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.
11452 .It Fl mlittle-endian
11453 On System V.4 and embedded PowerPC systems compile code for the processor in little endian mode.
11456 option is the same as
11461 On System V.4 and embedded PowerPC systems compile code for the processor in big endian mode.
11464 option is the same as
11467 .It Fl mdynamic-no-pic
11468 On Darwin and Mac OS X systems, compile code so that it is not relocatable, but that its external references are relocatable.
11469 The resulting code is suitable for applications, but not shared libraries.
11471 .It Fl mprioritize-restricted-insns= Ns Ar priority
11472 This option controls the priority that is assigned to dispatch-slot restricted instructions during the second scheduling pass.
11478 .Em no/highest/second-highest
11479 priority to dispatch slot restricted instructions.
11481 .It Fl msched-costly-dep= Ns Ar dependence_type
11482 This option controls which dependences are considered costly by the target during instruction scheduling.
11484 .Em dependence_type
11485 takes one of the following values:
11487 no dependence is costly,
11489 all dependences are costly,
11490 .Em true_store_to_load :
11491 a true dependence from store to load is costly,
11492 .Em store_to_load :
11493 any dependence from store to load is costly,
11495 any dependence which latency \*[Gt]=
11499 .It Fl minsert-sched-nops= Ns Ar scheme
11500 This option controls which nop insertion scheme will be used during the second scheduling pass.
11503 takes one of the following values:
11507 Pad with nops any dispatch group which has vacant issue slots, according to the scheduler's grouping.
11508 .Em regroup_exact :
11509 Insert nops to force costly dependent insns into separate groups.
11510 Insert exactly as many nops as needed to force an insn to a new group, according to the estimated processor grouping.
11512 Insert nops to force costly dependent insns into separate groups.
11515 nops to force an insn to a new group.
11518 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.
11519 This is the default unless you configured GCC using
11520 .Sy powerpc-*-eabiaix .
11522 .It Fl mcall-sysv-eabi
11529 .It Fl mcall-sysv-noeabi
11536 .It Fl mcall-solaris
11537 On System V.4 and embedded PowerPC systems compile code for the Solaris operating system.
11540 On System V.4 and embedded PowerPC systems compile code for the Linux-based GNU system.
11543 On System V.4 and embedded PowerPC systems compile code for the Hurd-based GNU system.
11545 .It Fl mcall-netbsd
11546 On System V.4 and embedded PowerPC systems compile code for the NetBSD operating system.
11548 .It Fl maix-struct-return
11549 Return all structures in memory (as specified by the AIX ABI).
11551 .It Fl msvr4-struct-return
11552 Return structures smaller than 8 bytes in registers (as specified by the SVR4 ABI).
11554 .It Fl mabi= Ns Ar abi-type
11555 Extend the current ABI with a particular extension, or remove such extension.
11561 .Em ibmlongdouble ,
11562 .Em ieeelongdouble .
11565 Extend the current ABI with SPE ABI extensions.
11566 This does not change the default ABI, instead it adds the SPE ABI extensions to the current ABI.
11569 Disable Booke SPE ABI extensions for the current ABI.
11571 .It Fl mabi=ibmlongdouble
11572 Change the current ABI to use IBM extended precision long double.
11573 This is a PowerPC 32-bit SYSV ABI option.
11575 .It Fl mabi=ieeelongdouble
11576 Change the current ABI to use IEEE extended precision long double.
11577 This is a PowerPC 32-bit Linux ABI option.
11580 .It Fl mno-prototype
11581 On System V.4 and embedded PowerPC systems assume that all calls to variable argument functions are properly prototyped.
11582 Otherwise, the compiler must insert an instruction before every non prototyped call to set or clear bit 6 of the condition code register
11584 to indicate whether floating point values were passed in the floating point registers in case the function takes a variable arguments.
11587 only calls to prototyped variable argument functions will set or clear the bit.
11590 On embedded PowerPC systems, assume that the startup module is called
11592 and that the standard C libraries are
11596 This is the default for
11597 .Sy powerpc-*-eabisim .
11601 On embedded PowerPC systems, assume that the startup module is called
11603 and the standard C libraries are
11609 On embedded PowerPC systems, assume that the startup module is called
11611 and the standard C libraries are
11616 .It Fl myellowknife
11617 On embedded PowerPC systems, assume that the startup module is called
11619 and the standard C libraries are
11625 On System V.4 and embedded PowerPC systems, specify that you are compiling for a VxWorks system.
11628 Specify that you are compiling for the WindISS simulation environment.
11631 On embedded PowerPC systems, set the
11633 bit in the ELF flags header to indicate that
11635 extended relocations are used.
11639 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.
11642 means that the stack is aligned to an 8 byte boundary, a function
11646 to set up the eabi environment, and the
11648 option can use both
11652 to point to two separate small data areas.
11655 means that the stack is aligned to a 16 byte boundary, do not call an initialization function from
11659 option will only use
11661 to point to a single small data area.
11664 option is on by default if you configured GCC using one of the
11665 .Sy powerpc*-*-eabi*
11669 On System V.4 and embedded PowerPC systems, put small initialized
11671 global and static data in the
11673 section, which is pointed to by register
11675 Put small initialized non-
11677 global and static data in the
11679 section, which is pointed to by register
11681 Put small uninitialized global and static data in the
11683 section, which is adjacent to the
11688 option is incompatible with the
11693 option also sets the
11698 On System V.4 and embedded PowerPC systems, put small global and static data in the
11700 section, which is pointed to by register
11702 Put small uninitialized global and static data in the
11704 section, which is adjacent to the
11709 option is incompatible with the
11713 .It Fl msdata=default
11715 On System V.4 and embedded PowerPC systems, if
11717 is used, compile code the same as
11719 otherwise compile code the same as
11723 On System V.4 and embedded PowerPC systems, put small global and static data in the
11726 Put small uninitialized global and static data in the
11729 Do not use register
11731 to address small data however.
11732 This is the default behavior unless other
11738 On embedded PowerPC systems, put all initialized global and static data in the
11740 section, and all uninitialized data in the
11745 On embedded PowerPC systems, put global and static items less than or equal to
11747 bytes into the small data or bss sections instead of the normal data or bss section.
11753 switch is also passed to the linker.
11754 All modules should be compiled with the same
11759 .It Fl mno-regnames
11760 On System V.4 and embedded PowerPC systems do (do not) emit register names in the assembly language output using symbolic forms.
11763 .It Fl mno-longcall
11764 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.
11765 This setting can be overridden by the
11767 function attribute, or by
11768 .Va #pragma longcall(0) .
11770 Some linkers are capable of detecting out-of-range calls and generating glue code on the fly.
11771 On these systems, long calls are unnecessary and generate slower code.
11772 As of this writing, the AIX linker can do this, as can the GNU linker for PowerPC/64.
11773 It is planned to add this feature to the GNU linker for 32-bit PowerPC systems as well.
11775 On Darwin/PPC systems,
11776 .Va #pragma longcall
11777 will generate "jbsr callee, L42", plus a "branch island" (glue code).
11778 The two target addresses represent the callee and the "branch island".
11779 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".
11780 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.
11782 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.
11784 In the future, we may cause GCC to ignore all longcall specifications when the linker is known to generate glue.
11787 Adds support for multithreading with the
11790 This option sets flags for both the preprocessor and linker.
11793 .It Sy S/390 and zSeries Options
11796 options defined for the S/390 and zSeries architecture.
11801 Use (do not use) the hardware floating-point instructions and registers for floating-point operations.
11804 is specified, functions in
11806 will be used to perform floating-point operations.
11809 is specified, the compiler generates IEEE floating-point instructions.
11810 This is the default.
11812 .It Fl mlong-double-64
11813 .It Fl mlong-double-128
11814 These switches control the size of
11817 A size of 64bit makes the
11819 type equivalent to the
11822 This is the default.
11825 .It Fl mno-backchain
11826 Store (do not store) the address of the caller's frame as backchain pointer into the callee's stack frame.
11827 A backchain may be needed to allow debugging using tools that do not understand DWARF-2 call frame information.
11829 .Fl mno-packed-stack
11830 is in effect, the backchain pointer is stored at the bottom of the stack frame; when
11832 is in effect, the backchain is placed into the topmost word of the 96/160 byte register save area.
11834 In general, code compiled with
11836 is call-compatible with code compiled with
11837 .Fl mmo-backchain ;
11838 however, use of the backchain for debugging purposes usually requires that the whole binary is built with
11840 Note that the combination of
11846 In order to build a linux kernel use
11849 The default is to not maintain the backchain.
11851 .It Fl mpacked-stack
11852 .It Fl mno-packed-stack
11853 Use (do not use) the packed stack layout.
11855 .Fl mno-packed-stack
11856 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.
11859 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.
11862 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.
11864 As long as the stack frame backchain is not used, code generated with
11866 is call-compatible with code generated with
11867 .Fl mno-packed-stack .
11868 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.
11869 Such code is not call-compatible with code compiled with
11870 .Fl mpacked-stack .
11871 Also, note that the combination of
11877 In order to build a linux kernel use
11880 The default is to not use the packed stack layout.
11883 .It Fl mno-small-exec
11884 Generate (or do not generate) code using the
11886 instruction to do subroutine calls.
11887 This only works reliably if the total executable size does not exceed 64k.
11888 The default is to use the
11890 instruction instead, which does not have this limitation.
11896 is specified, generate code compliant to the GNU/Linux for S/390 ABI.
11899 is specified, generate code compliant to the GNU/Linux for zSeries ABI.
11900 This allows GCC in particular to generate 64-bit instructions.
11903 targets, the default is
11914 is specified, generate code using the instructions available on z/Architecture.
11917 is specified, generate code using the instructions available on ESA/390.
11920 is not possible with
11922 When generating code compliant to the GNU/Linux for S/390 ABI, the default is
11924 When generating code compliant to the GNU/Linux for zSeries ABI, the default is
11929 Generate (or do not generate) code using the
11931 instruction to perform block moves.
11934 is specified, use a
11937 This is the default unless optimizing for size.
11941 Print (or do not print) additional debug information when compiling.
11942 The default is to not print debug information.
11944 .It Fl march= Ns Ar cpu-type
11945 Generate code that will run on
11947 which is the name of a system representing a certain processor type.
11948 Possible values for
11956 When generating code using the instructions available on z/Architecture, the default is
11958 Otherwise, the default is
11961 .It Fl mtune= Ns Ar cpu-type
11964 everything applicable about the generated code, except for the ABI and the set of available instructions.
11967 values is the same as for
11969 The default is the value used for
11973 .It Fl mno-tpf-trace
11974 Generate code that adds (does not add) in TPF OS specific branches to trace routines in the operating system.
11975 This option is off by default, even when compiling for the TPF OS.
11978 .It Fl mno-fused-madd
11979 Generate code that uses (does not use) the floating point multiply and accumulate instructions.
11980 These instructions are generated by default if hardware floating point is used.
11982 .It Fl mwarn-framesize= Ns Ar framesize
11983 Emit a warning if the current function exceeds the given frame size.
11984 Because this is a compile time check it doesn't need to be a real problem when the program runs.
11985 It is intended to identify functions which most probably cause a stack overflow.
11986 It is useful to be used in an environment with limited stack size e.g. the linux kernel.
11988 .It Fl mwarn-dynamicstack
11989 Emit a warning if the function calls alloca or uses dynamically sized arrays.
11990 This is generally a bad idea with a limited stack size.
11992 .It Fl mstack-guard= Ns Ar stack-guard
11993 .It Fl mstack-size= Ns Ar stack-size
11994 These arguments always have to be used in conjunction.
11995 If they are present the s390 back end emits additional instructions in the function prologue which trigger a trap if the stack size is
11999 (remember that the stack on s390 grows downward).
12000 These options are intended to be used to help debugging stack overflow problems.
12001 The additionally emitted code causes only little overhead and hence can also be used in production like systems without greater performance degradation.
12002 The given values have to be exact powers of 2 and
12004 has to be greater than
12006 without exceeding 64k.
12007 In order to be efficient the extra code makes the assumption that the stack starts at an address aligned to the value given by
12014 options are defined for the SH implementations:
12018 Generate code for the SH1.
12021 Generate code for the SH2.
12024 Generate code for the SH2e.
12027 Generate code for the SH3.
12030 Generate code for the SH3e.
12033 Generate code for the SH4 without a floating-point unit.
12035 .It Fl m4-single-only
12036 Generate code for the SH4 with a floating-point unit that only supports single-precision arithmetic.
12039 Generate code for the SH4 assuming the floating-point unit is in single-precision mode by default.
12042 Generate code for the SH4.
12045 Generate code for the SH4al-dsp, or for a SH4a in such a way that the floating-point unit is not used.
12047 .It Fl m4a-single-only
12048 Generate code for the SH4a, in such a way that no double-precision floating point operations are used.
12051 Generate code for the SH4a assuming the floating-point unit is in single-precision mode by default.
12054 Generate code for the SH4a.
12059 except that it implicitly passes
12062 GCC doesn't generate any DSP instructions at the moment.
12065 Compile code for the processor in big endian mode.
12068 Compile code for the processor in little endian mode.
12071 Align doubles at 64-bit boundaries.
12072 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
12076 Shorten some address references at link time, when possible; uses the linker option
12080 Use 32-bit offsets in
12083 The default is to use 16-bit offsets.
12086 Enable the use of the instruction
12090 Comply with the calling conventions defined by Renesas.
12093 Comply with the calling conventions defined by Renesas.
12096 Comply with the calling conventions defined for GCC before the Renesas conventions were available.
12097 This option is the default for all targets of the SH toolchain except for
12098 .Sy sh-symbianelf .
12103 register as call-clobbered, even if
12108 Increase IEEE-compliance of floating-point code.
12109 At the moment, this is equivalent to
12110 .Fl fno-finite-math-only .
12111 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
12112 .Fl ffinite-math-only .
12115 Dump instruction size and location in the assembly code.
12118 This option is deprecated.
12119 It pads structures to multiple of 4 bytes, which is incompatible with the SH ABI.
12122 Optimize for space instead of speed.
12127 When generating position-independent code, emit function calls using the Global Offset Table instead of the Procedure Linkage Table.
12130 Generate a library function call to invalidate instruction cache entries, after fixing up a trampoline.
12131 This library function call doesn't assume it can write to the whole memory address space.
12132 This is the default when the target is
12135 .It Fl multcost= Ns Ar number
12136 Set the cost to assume for a multiply insn.
12138 .It Fl mdiv= Ns Ar strategy
12139 Set the division strategy to use for SHmedia code.
12141 must be one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, inv:call, inv:call2, inv:fp.
12142 "fp" performs the operation in floating point.
12143 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.
12144 Division by zero causes a floating point exception.
12145 "inv" uses integer operations to calculate the inverse of the divisor, and then multiplies the dividend with the inverse.
12146 This strategy allows cse and hoisting of the inverse calculation.
12147 Division by zero calculates an unspecified result, but does not trap.
12148 "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.
12149 "call" calls a library function that usually implements the inv:minlat strategy.
12150 This gives high code density for m5-*media-nofpu compilations.
12151 "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.
12152 "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.
12153 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.
12154 A recombination to fp operations or a call is not possible in that case.
12155 "inv20u" and "inv20l" are variants of the "inv:minlat" strategy.
12156 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.
12157 inv20u assumes the case of a such a small dividend to be unlikely, and inv20l assumes it to be likely.
12159 .It Fl mdivsi3_libfunc= Ns Ar name
12160 Set the name of the library function used for 32 bit signed division to
12162 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.
12164 .It Fl madjust-unroll
12165 Throttle unrolling to avoid thrashing target registers.
12166 This option only has an effect if the gcc code base supports the TARGET_ADJUST_UNROLL_MAX target hook.
12168 .It Fl mindexed-addressing
12169 Enable the use of the indexed addressing mode for SHmedia32/SHcompact.
12170 This is only safe if the hardware and/or OS implement 32 bit wrap-around semantics for the indexed addressing mode.
12171 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.
12173 .It Fl mgettrcost= Ns Ar number
12174 Set the cost assumed for the gettr instruction to
12176 The default is 2 if
12178 is in effect, 100 otherwise.
12181 Assume pt* instructions won't trap.
12182 This will generally generate better scheduled code, but is unsafe on current hardware.
12183 The current architecture definition says that ptabs and ptrel trap when the target anded with 3 is 3.
12184 This has the unintentional effect of making it unsafe to schedule ptabs / ptrel before a branch, or hoist it out of a loop.
12185 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.
12186 With the -mpt-fixed option, the ptabs will be done before testing against -1.
12187 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.
12188 Since this option is unsafe for any hardware implementing the current architecture specification, the default is -mno-pt-fixed.
12189 Unless the user specifies a specific cost with
12191 -mno-pt-fixed also implies
12192 .Fl mgettrcost=100 ;
12193 this deters register allocation using target registers for storing ordinary integers.
12195 .It Fl minvalid-symbols
12196 Assume symbols might be invalid.
12197 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.
12198 This option is only meaningful when
12201 It will then prevent cross-basic-block cse, hoisting and most scheduling of symbol loads.
12203 .Fl mno-invalid-symbols .
12206 .It Sy SPARC Options
12209 options are supported on the SPARC:
12212 .It Fl mno-app-regs
12216 to generate output using the global registers 2 through 4, which the SPARC SVR4 ABI reserves for applications.
12217 This is the default.
12219 To be fully SVR4 ABI compliant at the cost of some performance loss, specify
12221 You should compile libraries and system software with this option.
12225 Generate output containing floating point instructions.
12226 This is the default.
12230 Generate output containing library calls for floating point.
12232 the requisite libraries are not available for all SPARC targets.
12233 Normally the facilities of the machine's usual C compiler are used, but this cannot be done directly in cross-compilation.
12234 You must make your own arrangements to provide suitable library functions for cross-compilation.
12235 The embedded targets
12239 do provide software floating point support.
12242 changes the calling convention in the output file; therefore, it is only useful if you compile
12244 of a program with this option.
12245 In particular, you need to compile
12247 the library that comes with GCC, with
12249 in order for this to work.
12251 .It Fl mhard-quad-float
12252 Generate output containing quad-word (long double) floating point instructions.
12254 .It Fl msoft-quad-float
12255 Generate output containing library calls for quad-word (long double) floating point instructions.
12256 The functions called are those specified in the SPARC ABI.
12257 This is the default.
12259 As of this writing, there are no SPARC implementations that have hardware support for the quad-word floating point instructions.
12260 They all invoke a trap handler for one of these instructions, and then the trap handler emulates the effect of the instruction.
12261 Because of the trap handler overhead, this is much slower than calling the ABI library routines.
12263 .Fl msoft-quad-float
12264 option is the default.
12266 .It Fl mno-unaligned-doubles
12267 .It Fl munaligned-doubles
12268 Assume that doubles have 8 byte alignment.
12269 This is the default.
12272 .Fl munaligned-doubles ,
12273 GCC assumes that doubles have 8 byte alignment only if they are contained in another type, or if they have an absolute address.
12274 Otherwise, it assumes they have 4 byte alignment.
12275 Specifying this option avoids some rare compatibility problems with code generated by other compilers.
12276 It is not the default because it results in a performance loss, especially for floating point code.
12278 .It Fl mno-faster-structs
12279 .It Fl mfaster-structs
12281 .Fl mfaster-structs ,
12282 the compiler assumes that structures should have 8 byte alignment.
12283 This enables the use of pairs of
12287 instructions for copies in structure assignment, in place of twice as many
12292 However, the use of this changed alignment directly violates the SPARC ABI.
12293 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.
12295 .It Fl mimpure-text
12297 used in addition to
12299 tells the compiler to not pass
12301 to the linker when linking a shared object.
12302 Using this option, you can link position-dependent code into a shared object.
12305 suppresses the "relocations remain against allocatable but non-writable sections" linker error message.
12306 However, the necessary relocations will trigger copy-on-write, and the shared object is not actually shared across processes.
12309 you should compile all source code with
12314 This option is only available on SunOS and Solaris.
12316 .It Fl mcpu= Ns Ar cpu_type
12317 Set the instruction set, register set, and instruction scheduling parameters for machine type
12319 Supported values for
12338 Default instruction scheduling parameters are used for values that select an architecture and not an implementation.
12346 Here is a list of each supported architecture and their supported implementations.
12348 .Bd -literal -offset indent
12350 v8: supersparc, hypersparc
12351 sparclite: f930, f934, sparclite86x
12353 v9: ultrasparc, ultrasparc3
12355 By default (unless configured otherwise), GCC generates code for the V7 variant of the SPARC architecture.
12358 the compiler additionally optimizes it for the Cypress CY7C602 chip, as used in the SPARCStation/SPARCServer 3xx series.
12359 This is also appropriate for the older SPARCStation 1, 2, IPX etc.
12363 GCC generates code for the V8 variant of the SPARC architecture.
12364 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.
12366 .Fl mcpu=supersparc ,
12367 the compiler additionally optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and 2000 series.
12370 .Fl mcpu=sparclite ,
12371 GCC generates code for the SPARClite variant of the SPARC architecture.
12372 This adds the integer multiply, integer divide step and scan
12374 instructions which exist in SPARClite but not in SPARC-V7.
12377 the compiler additionally optimizes it for the Fujitsu MB86930 chip, which is the original SPARClite, with no FPU.
12380 the compiler additionally optimizes it for the Fujitsu MB86934 chip, which is the more recent SPARClite with FPU.
12383 .Fl mcpu=sparclet ,
12384 GCC generates code for the SPARClet variant of the SPARC architecture.
12385 This adds the integer multiply, multiply/accumulate, integer divide step and scan
12387 instructions which exist in SPARClet but not in SPARC-V7.
12390 the compiler additionally optimizes it for the TEMIC SPARClet chip.
12394 GCC generates code for the V9 variant of the SPARC architecture.
12395 This adds 64-bit integer and floating-point move instructions, 3 additional floating-point condition code registers and conditional move instructions.
12397 .Fl mcpu=ultrasparc ,
12398 the compiler additionally optimizes it for the Sun UltraSPARC I/II chips.
12400 .Fl mcpu=ultrasparc3 ,
12401 the compiler additionally optimizes it for the Sun UltraSPARC III chip.
12403 .It Fl mtune= Ns Ar cpu_type
12404 Set the instruction scheduling parameters for machine type
12406 but do not set the instruction set or register set that the option
12407 .Fl mcpu= Ns Ar cpu_type
12410 The same values for
12411 .Fl mcpu= Ns Ar cpu_type
12413 .Fl mtune= Ns Ar cpu_type ,
12414 but the only useful values are those that select a particular cpu implementation.
12431 GCC generates code for the SPARC-V8+ ABI.
12432 The difference from the V8 ABI is that the global and out registers are considered 64-bit wide.
12433 This is enabled by default on Solaris in 32-bit mode for all SPARC-V9 processors.
12439 GCC generates code that takes advantage of the UltraSPARC Visual Instruction Set extensions.
12446 options are supported in addition to the above on SPARC-V9 processors in 64-bit environments:
12449 .It Fl mlittle-endian
12450 Generate code for a processor running in little-endian mode.
12451 It is only available for a few configurations and most notably not on Solaris and Linux.
12455 Generate code for a 32-bit or 64-bit environment.
12456 The 32-bit environment sets int, long and pointer to 32 bits.
12457 The 64-bit environment sets int to 32 bits and long and pointer to 64 bits.
12459 .It Fl mcmodel=medlow
12460 Generate code for the Medium/Low code model: 64-bit addresses, programs must be linked in the low 32 bits of memory.
12461 Programs can be statically or dynamically linked.
12463 .It Fl mcmodel=medmid
12464 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.
12466 .It Fl mcmodel=medany
12467 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.
12469 .It Fl mcmodel=embmedany
12470 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).
12471 The global register %g4 points to the base of the data segment.
12472 Programs are statically linked and PIC is not supported.
12475 .It Fl mno-stack-bias
12478 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.
12479 This is the default in 64-bit mode.
12480 Otherwise, assume no such offset is present.
12483 These switches are supported in addition to the above on Solaris:
12487 Add support for multithreading using the Solaris threads library.
12488 This option sets flags for both the preprocessor and linker.
12489 This option does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it.
12492 Add support for multithreading using the POSIX threads library.
12493 This option sets flags for both the preprocessor and linker.
12494 This option does not affect the thread safety of object code produced by the compiler or that of libraries supplied with it.
12497 This is a synonym for
12501 .It Sy Options for System V
12502 These additional options are available on System V Release 4 for compatibility with other compilers on those systems:
12506 Create a shared object.
12507 It is recommended that
12514 Identify the versions of each tool used by the compiler, in a
12516 assembler directive in the output.
12519 Refrain from adding
12521 directives to the output file (this is the default).
12523 .It Fl YP, Ns Ar dirs
12524 Search the directories
12526 and no others, for libraries specified with
12529 .It Fl Ym, Ns Ar dir
12530 Look in the directory
12532 to find the M4 preprocessor.
12533 The assembler uses this option.
12536 .It Sy TMS320C3x/C4x Options
12539 options are defined for TMS320C3x/C4x implementations:
12542 .It Fl mcpu= Ns Ar cpu_type
12543 Set the instruction set, register set, and instruction scheduling parameters for machine type
12545 Supported values for
12556 to generate code for the TMS320C40.
12560 .It Fl msmall-memory
12562 Generates code for the big or small memory model.
12563 The small memory model assumed that all data fits into one 64K word page.
12564 At run-time the data page (DP) register must be set to point to the 64K page containing the .bss and .data program sections.
12565 The big memory model is the default and requires reloading of the DP register for every direct memory access.
12569 Allow (disallow) allocation of general integer operands into the block count register BK.
12573 Enable (disable) generation of code using decrement and branch, DBcond(D), instructions.
12574 This is enabled by default for the C4x.
12575 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?).
12576 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.
12577 Thus a loop where the loop counter is decremented can generate slightly more efficient code, in cases where the RPTB instruction cannot be utilized.
12579 .It Fl mdp-isr-reload
12581 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.
12582 This should not be required unless someone has violated the small memory model by modifying the DP register, say within an object library.
12586 For the C3x use the 24-bit MPYI instruction for integer multiplies instead of a library call to guarantee 32-bit results.
12587 Note that if one of the operands is a constant, then the multiplication will be performed using shifts and adds.
12590 option is not specified for the C3x, then squaring operations are performed inline instead of a library call.
12593 .It Fl mno-fast-fix
12594 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.
12595 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.
12596 This option can be used to disable generation of the additional code required to correct the result.
12600 Enable (disable) generation of repeat block sequences using the RPTB instruction for zero overhead looping.
12601 The RPTB construct is only used for innermost loops that do not call functions or jump across the loop boundaries.
12602 There is no advantage having nested RPTB loops due to the overhead required to save and restore the RC, RS, and RE registers.
12603 This is enabled by default with
12606 .It Fl mrpts= Ns Ar count
12608 Enable (disable) the use of the single instruction repeat instruction RPTS.
12609 If a repeat block contains a single instruction, and the loop count can be guaranteed to be less than the value
12611 GCC will emit a RPTS instruction instead of a RPTB.
12612 If no value is specified, then a RPTS will be emitted even if the loop count cannot be determined at compile time.
12613 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.
12614 However, since interrupts are blocked by this instruction, it is disabled by default.
12616 .It Fl mloop-unsigned
12617 .It Fl mno-loop-unsigned
12618 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.
12619 If the iteration count is unsigned there is a possibility than the 2^{31 + 1} maximum iteration count may be exceeded.
12620 This switch allows an unsigned iteration count.
12623 Try to emit an assembler syntax that the TI assembler (asm30) is happy with.
12624 This also enforces compatibility with the API employed by the TI C3x C compiler.
12625 For example, long doubles are passed as structures rather than in floating point registers.
12629 Generate code that uses registers (stack) for passing arguments to functions.
12630 By default, arguments are passed in registers where possible rather than by pushing arguments on to the stack.
12632 .It Fl mparallel-insns
12633 .It Fl mno-parallel-insns
12634 Allow the generation of parallel instructions.
12635 This is enabled by default with
12638 .It Fl mparallel-mpy
12639 .It Fl mno-parallel-mpy
12640 Allow the generation of MPY||ADD and MPY||SUB parallel instructions, provided
12641 .Fl mparallel-insns
12643 These instructions have tight register constraints which can pessimize the code generation of large functions.
12646 .It Sy V850 Options
12649 options are defined for V850 implementations:
12653 .It Fl mno-long-calls
12654 Treat all calls as being far away (near).
12655 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.
12659 Do not optimize (do optimize) basic blocks that use the same index pointer 4 or more times to copy pointer into the
12661 register, and use the shorter
12668 option is on by default if you optimize.
12670 .It Fl mno-prolog-function
12671 .It Fl mprolog-function
12672 Do not use (do use) external functions to save and restore registers at the prologue and epilogue of a function.
12673 The external functions are slower, but use less code space if more than one function saves the same number of registers.
12675 .Fl mprolog-function
12676 option is on by default if you optimize.
12679 Try to make the code as small as possible.
12680 At present, this just turns on the
12683 .Fl mprolog-function
12686 .It Fl mtda= Ns Ar n
12687 Put static or global variables whose size is
12689 bytes or less into the tiny data area that register
12692 The tiny data area can hold up to 256 bytes in total (128 bytes for byte references).
12694 .It Fl msda= Ns Ar n
12695 Put static or global variables whose size is
12697 bytes or less into the small data area that register
12700 The small data area can hold up to 64 kilobytes.
12702 .It Fl mzda= Ns Ar n
12703 Put static or global variables whose size is
12705 bytes or less into the first 32 kilobytes of memory.
12708 Specify that the target processor is the V850.
12711 Generate code suitable for big switch tables.
12712 Use this option only if the assembler/linker complain about out of range branches within a switch table.
12715 This option will cause r2 and r5 to be used in the code generated by the compiler.
12716 This setting is the default.
12718 .It Fl mno-app-regs
12719 This option will cause r2 and r5 to be treated as fixed registers.
12722 Specify that the target processor is the V850E1.
12723 The preprocessor constants
12727 will be defined if this option is used.
12730 Specify that the target processor is the V850E.
12731 The preprocessor constant
12733 will be defined if this option is used.
12741 are defined then a default target processor will be chosen and the relevant
12743 preprocessor constant will be defined.
12745 The preprocessor constants
12749 are always defined, regardless of which processor variant is the target.
12751 .It Fl mdisable-callt
12752 This option will suppress generation of the CALLT instruction for the v850e and v850e1 flavors of the v850 architecture.
12754 .Fl mno-disable-callt
12755 which allows the CALLT instruction to be used.
12761 options are defined for the VAX:
12765 Do not output certain jump instructions
12767 and so on) that the Unix assembler for the VAX cannot handle across long ranges.
12770 Do output those jump instructions, on the assumption that you will assemble with the GNU assembler.
12773 Output code for g-format floating point numbers instead of d-format.
12776 .It Sy x86-64 Options
12777 These are listed under
12778 .It Sy Xstormy16 Options
12779 These options are defined for Xstormy16:
12783 Choose startup files and linker script suitable for the simulator.
12786 .It Sy Xtensa Options
12787 These options are supported for Xtensa targets:
12792 Enable or disable use of
12794 instructions for loading constant values.
12797 instruction is currently not a standard option from Tensilica.
12800 instructions are always used in place of the standard
12805 is enabled by default only if the
12807 instruction is not available.
12810 .It Fl mno-fused-madd
12811 Enable or disable use of fused multiply/add and multiply/subtract instructions in the floating-point option.
12812 This has no effect if the floating-point option is not also enabled.
12813 Disabling fused multiply/add and multiply/subtract instructions forces the compiler to use separate instructions for the multiply and add/subtract operations.
12814 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
12816 bits of precision than specified by the IEEE standard.
12817 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.
12819 .It Fl mtext-section-literals
12820 .It Fl mno-text-section-literals
12821 Control the treatment of literal pools.
12823 .Fl mno-text-section-literals ,
12824 which places literals in a separate section in the output file.
12825 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.
12827 .Fl mtext-section-literals ,
12828 the literals are interspersed in the text section in order to keep them as close as possible to their references.
12829 This may be necessary for large assembly files.
12831 .It Fl mtarget-align
12832 .It Fl mno-target-align
12833 When this option is enabled, GCC instructs the assembler to automatically align instructions to reduce branch penalties at the expense of some code density.
12834 The assembler attempts to widen density instructions to align branch targets and the instructions following call instructions.
12835 If there are not enough preceding safe density instructions to align a target, no widening will be performed.
12837 .Fl mtarget-align .
12838 These options do not affect the treatment of auto-aligned instructions like
12840 which the assembler will always align, either by widening density instructions or by inserting no-op instructions.
12843 .It Fl mno-longcalls
12844 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.
12845 This translation typically occurs for calls to functions in other source files.
12846 Specifically, the assembler translates a direct
12848 instruction into an
12854 .Fl mno-longcalls .
12855 This option should be used in programs where the call target can potentially be out of range.
12856 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.
12857 Note that the assembler will use an indirect call for every cross-file call, not just those that really will be out of range.
12860 .It Sy zSeries Options
12861 These are listed under
12863 .Ss Options for Code Generation Conventions
12864 These machine-independent options control the interface conventions used in code generation.
12866 Most of them have both positive and negative forms; the negative form of
12870 In the table below, only one of the forms is listed---the one which is not the default.
12871 You can figure out the other form by either removing
12876 .It Fl fbounds-check
12877 For front-ends that support it, generate additional code to check that indices used to access arrays are within the declared range.
12878 This is currently only supported by the Java and Fortran front-ends, where this option defaults to true and false respectively.
12881 This option generates traps for signed overflow on addition, subtraction, multiplication operations.
12884 This option instructs the compiler to assume that signed arithmetic overflow of addition, subtraction and multiplication wraps around using twos-complement representation.
12885 This flag enables some optimizations and disables others.
12886 This option is enabled by default for the Java front-end, as required by the Java language specification.
12889 Enable exception handling.
12890 Generates extra code needed to propagate exceptions.
12891 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.
12892 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.
12893 However, you may need to enable this option when compiling C code that needs to interoperate properly with exception handlers written in C++.
12894 You may also wish to disable this option if you are compiling older C++ programs that don't use exception handling.
12896 .It Fl fnon-call-exceptions
12897 Generate code that allows trapping instructions to throw exceptions.
12898 Note that this requires platform-specific runtime support that does not exist everywhere.
12899 Moreover, it only allows
12901 instructions to throw exceptions, i.e. memory references or floating point instructions.
12902 It does not allow exceptions to be thrown from arbitrary signal handlers such as
12905 .It Fl funwind-tables
12908 except that it will just generate any needed static data, but will not affect the generated code in any other way.
12909 You will normally not enable this option; instead, a language processor that needs this handling would enable it on your behalf.
12911 .It Fl fasynchronous-unwind-tables
12912 Generate unwind table in dwarf2 format, if supported by target machine.
12913 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).
12915 .It Fl fpcc-struct-return
12920 values in memory like longer ones, rather than in registers.
12921 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).
12923 The precise convention for returning structures in memory depends on the target configuration macros.
12925 Short structures and unions are those whose size and alignment match that of some integer type.
12928 code compiled with the
12929 .Fl fpcc-struct-return
12930 switch is not binary compatible with code compiled with the
12931 .Fl freg-struct-return
12933 Use it to conform to a non-default application binary interface.
12935 .It Fl freg-struct-return
12940 values in registers when possible.
12941 This is more efficient for small structures than
12942 .Fl fpcc-struct-return .
12944 If you specify neither
12945 .Fl fpcc-struct-return
12947 .Fl freg-struct-return ,
12948 GCC defaults to whichever convention is standard for the target.
12949 If there is no standard convention, GCC defaults to
12950 .Fl fpcc-struct-return ,
12951 except on targets where GCC is the principal compiler.
12952 In those cases, we can choose the standard, and we chose the more efficient register return alternative.
12955 code compiled with the
12956 .Fl freg-struct-return
12957 switch is not binary compatible with code compiled with the
12958 .Fl fpcc-struct-return
12960 Use it to conform to a non-default application binary interface.
12962 .It Fl fshort-enums
12965 type only as many bytes as it needs for the declared range of possible values.
12968 type will be equivalent to the smallest integer type which has enough room.
12973 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
12974 Use it to conform to a non-default application binary interface.
12976 .It Fl fshort-double
12977 Use the same size for
12985 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
12986 Use it to conform to a non-default application binary interface.
12988 .It Fl fshort-wchar
12989 Override the underlying type for
12992 .Sy short unsigned int
12993 instead of the default for the target.
12994 This option is useful for building programs to run under WINE.
12999 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
13000 Use it to conform to a non-default application binary interface.
13002 .It Fl fshared-data
13003 Requests that the data and non-
13005 variables of this compilation be shared data rather than private data.
13006 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.
13009 In C, allocate even uninitialized global variables in the data section of the object file, rather than generating them as common blocks.
13010 This has the effect that if the same variable is declared (without
13012 in two different compilations, you will get an error when you link them.
13013 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.
13020 .It Fl finhibit-size-directive
13023 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.
13024 This option is used when compiling
13026 you should not need to use it for anything else.
13028 .It Fl fverbose-asm
13029 Put extra commentary information in the generated assembly code to make it more readable.
13030 This option is generally only of use to those who actually need to read the generated assembly code (perhaps while debugging the compiler itself).
13032 .Fl fno-verbose-asm ,
13033 the default, causes the extra information to be omitted and is useful when comparing two assembler files.
13036 Generate position-independent code (PIC) suitable for use in a shared library, if supported for the target machine.
13037 Such code accesses all constant addresses through a global offset table (GOT).
13038 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).
13039 If the GOT size for the linked executable exceeds a machine-specific maximum size, you get an error message from the linker indicating that
13041 does not work; in that case, recompile with
13044 (These maximums are 8k on the SPARC and 32k on the m68k and RS/6000.
13045 The 386 has no such limit.)
13047 Position-independent code requires special support, and therefore works only on certain machines.
13048 For the 386, GCC supports PIC for System V but not for the Sun 386i.
13049 Code generated for the IBM RS/6000 is always position-independent.
13052 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.
13053 This option makes a difference on the m68k, PowerPC and SPARC.
13055 Position-independent code requires special support, and therefore works only on certain machines.
13059 These options are similar to
13063 but generated position independent code can be only linked into executables.
13064 Usually these options are used when
13066 GCC option will be used during linking.
13068 .It Fl fno-jump-tables
13069 Do not use jump tables for switch statements even where it would be more efficient than other code generation strategies.
13070 This option is of use in conjunction with
13074 for building code which forms part of a dynamic linker and cannot reference the address of a jump table.
13075 On some targets, jump tables do not require a GOT and this option is not needed.
13077 .It Fl ffixed- Ns Ar reg
13078 Treat the register named
13080 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).
13083 must be the name of a register.
13084 The register names accepted are machine-specific and are defined in the
13086 macro in the machine description macro file.
13088 This flag does not have a negative form, because it specifies a three-way choice.
13090 .It Fl fcall-used- Ns Ar reg
13091 Treat the register named
13093 as an allocable register that is clobbered by function calls.
13094 It may be allocated for temporaries or variables that do not live across a call.
13095 Functions compiled this way will not save and restore the register
13098 It is an error to used this flag with the frame pointer or stack pointer.
13099 Use of this flag for other registers that have fixed pervasive roles in the machine's execution model will produce disastrous results.
13101 This flag does not have a negative form, because it specifies a three-way choice.
13103 .It Fl fcall-saved- Ns Ar reg
13104 Treat the register named
13106 as an allocable register saved by functions.
13107 It may be allocated even for temporaries or variables that live across a call.
13108 Functions compiled this way will save and restore the register
13112 It is an error to used this flag with the frame pointer or stack pointer.
13113 Use of this flag for other registers that have fixed pervasive roles in the machine's execution model will produce disastrous results.
13115 A different sort of disaster will result from the use of this flag for a register in which function values may be returned.
13117 This flag does not have a negative form, because it specifies a three-way choice.
13119 .It Sy -fpack-struct[= Ns Em n Ns Sy ] Ns
13120 Without a value specified, pack all structure members together without holes.
13121 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.
13126 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
13127 Additionally, it makes the code suboptimal.
13128 Use it to conform to a non-default application binary interface.
13130 .It Fl finstrument-functions
13131 Generate instrumentation calls for entry and exit to functions.
13132 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.
13133 (On some platforms,
13134 .Va __builtin_return_address
13135 does not work beyond the current function, so the call site information may not be available to the profiling functions otherwise.)
13137 .Bd -literal -offset indent
13138 void __cyg_profile_func_enter (void *this_fn,
13140 void __cyg_profile_func_exit (void *this_fn,
13143 The first argument is the address of the start of the current function, which may be looked up exactly in the symbol table.
13145 This instrumentation is also done for functions expanded inline in other functions.
13146 The profiling calls will indicate where, conceptually, the inline function is entered and exited.
13147 This means that addressable versions of such functions must be available.
13148 If all your uses of a function are expanded inline, this may mean an additional expansion of code size.
13151 in your C code, an addressable version of such functions must be provided.
13152 (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.)
13154 A function may be given the attribute
13155 .Va no_instrument_function ,
13156 in which case this instrumentation will not be done.
13157 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).
13159 .It Fl fstack-check
13160 Generate code to verify that you do not go beyond the boundary of the stack.
13161 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.
13163 Note that this switch does not actually cause checking to be done; the operating system must do that.
13164 The switch causes generation of code to ensure that the operating system sees the stack being extended.
13166 .It Fl fstack-limit-register= Ns Ar reg
13167 .It Fl fstack-limit-symbol= Ns Ar sym
13168 .It Fl fno-stack-limit
13169 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.
13170 If the stack would grow beyond the value, a signal is raised.
13171 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.
13173 For instance, if the stack starts at absolute address
13175 and grows downwards, you can use the flags
13176 .Fl fstack-limit-symbol=__stack_limit
13178 .Fl Wl,--defsym,__stack_limit=0x7ffe0000
13179 to enforce a stack limit of 128KB.
13180 Note that this may only work with the GNU linker.
13182 .It Fl fargument-alias
13183 .It Fl fargument-noalias
13184 .It Fl fargument-noalias-global
13185 Specify the possible relationships among parameters and between parameters and global data.
13187 .Fl fargument-alias
13188 specifies that arguments (parameters) may alias each other and may alias global storage.
13189 .Fl fargument-noalias
13190 specifies that arguments do not alias each other, but may alias global storage.
13191 .Fl fargument-noalias-global
13192 specifies that arguments do not alias each other and do not alias global storage.
13194 Each language will automatically use whatever option is required by the language standard.
13195 You should not need to use these options yourself.
13197 .It Fl fleading-underscore
13198 This option and its counterpart,
13199 .Fl fno-leading-underscore ,
13200 forcibly change the way C symbols are represented in the object file.
13201 One use is to help link with legacy assembly code.
13205 .Fl fleading-underscore
13206 switch causes GCC to generate code that is not binary compatible with code generated without that switch.
13207 Use it to conform to a non-default application binary interface.
13208 Not all targets provide complete support for this switch.
13210 .It Fl ftls-model= Ns Ar model
13211 Alter the thread-local storage model to be used.
13214 argument should be one of
13215 .Va global-dynamic ,
13216 .Va local-dynamic ,
13221 The default without
13228 .Va global-dynamic .
13230 .It Fl fvisibility= Ns Ar default|internal|hidden|protected
13231 Set the default ELF image symbol visibility to the specified option---all symbols will be marked with this unless overridden within the code.
13232 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.
13235 recommended that you use this in any shared objects you distribute.
13237 Despite the nomenclature,
13239 always means public ie; available to be linked against from outside the shared object.
13243 are pretty useless in real-world usage so the only other commonly used option will be
13249 i.e., make every symbol public---this causes the same behavior as previous versions of GCC.
13251 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
13252 .Lk http://people.redhat.com/~drepper/ )
13253 ---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.
13254 This is the norm with DLL's on Windows and with
13255 .Fl fvisibility=hidden
13257 .Va __attribute__ ((visibility("default")))
13259 .Va __declspec(dllexport)
13260 you get almost identical semantics with identical syntax.
13261 This is a great boon to those working with cross-platform projects.
13263 For those adding visibility support to existing code, you may find
13264 .Sy #pragma GCC visibility
13266 This works by you enclosing the declarations you wish to set visibility for with (for example)
13267 .Sy #pragma GCC visibility push(hidden)
13269 .Sy #pragma GCC visibility pop .
13270 Bear in mind that symbol visibility should be viewed
13271 .Sy as part of the API interface contract
13272 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
13274 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.
13275 Note that due to ISO C++ specification requirements, operator new and operator delete must always be of default visibility.
13277 An overview of these techniques, their benefits and how to use them is at
13278 .Lk http://gcc.gnu.org/wiki/Visibility .
13282 This section describes several environment variables that affect how GCC operates.
13283 Some of them work by specifying directories or prefixes to use when searching for various kinds of files.
13284 Some are used to specify other aspects of the compilation environment.
13286 Note that you can also specify places to search using options such as
13291 These take precedence over places specified using environment variables, which in turn take precedence over those specified by the configuration of GCC.
13296 .It Sy LC_MESSAGES Ns
13298 These environment variables control the way that GCC uses localization information that allow GCC to work with different national conventions.
13299 GCC inspects the locale categories
13303 if it has been configured to do so.
13304 These locale categories can be set to any value supported by your installation.
13307 for English in the United Kingdom encoded in UTF-8.
13311 environment variable specifies character classification.
13312 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.
13316 environment variable specifies the language to use in diagnostic messages.
13320 environment variable is set, it overrides the value of
13328 default to the value of the
13330 environment variable.
13331 If none of these variables are set, GCC defaults to traditional C English behavior.
13336 is set, it specifies the directory to use for temporary files.
13337 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.
13339 .It Sy GCC_EXEC_PREFIX Ns
13341 .Sy GCC_EXEC_PREFIX
13342 is set, it specifies a prefix to use in the names of the subprograms executed by the compiler.
13343 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.
13346 .Sy GCC_EXEC_PREFIX
13347 is not set, GCC will attempt to figure out an appropriate prefix to use based on the pathname it was invoked with.
13349 If GCC cannot find the subprogram using the specified prefix, it tries looking in the usual places for the subprogram.
13351 The default value of
13352 .Sy GCC_EXEC_PREFIX
13354 .Pa prefix/lib/gcc/
13363 Other prefixes specified with
13365 take precedence over this prefix.
13367 This prefix is also used for finding files such as
13369 that are used for linking.
13371 In addition, the prefix is used in an unusual way in finding the directories to search for header files.
13372 For each of the standard directories whose name normally begins with
13373 .Sy /usr/local/lib/gcc
13374 (more precisely, with the value of
13375 .Sy GCC_INCLUDE_DIR ) ,
13376 GCC tries replacing that beginning with the specified prefix to produce an alternate directory name.
13381 where it would normally search
13382 .Pa /usr/local/lib/bar .
13383 These alternate directories are searched first; the standard directories come next.
13385 .It Sy COMPILER_PATH Ns
13388 is a colon-separated list of directories, much like
13390 GCC tries the directories thus specified when searching for subprograms, if it can't find the subprograms using
13391 .Sy GCC_EXEC_PREFIX .
13393 .It Sy LIBRARY_PATH Ns
13396 is a colon-separated list of directories, much like
13398 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
13399 .Sy GCC_EXEC_PREFIX .
13400 Linking using GCC also uses these directories when searching for ordinary libraries for the
13402 option (but directories specified with
13407 This variable is used to pass locale information to the compiler.
13408 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++.
13409 When the compiler is configured to allow multibyte characters, the following values for
13415 Recognize JIS characters.
13418 Recognize SJIS characters.
13421 Recognize EUCJP characters.
13426 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.
13429 Some additional environments variables affect the behavior of the preprocessor.
13433 .It Sy C_INCLUDE_PATH Ns
13434 .It Sy CPLUS_INCLUDE_PATH Ns
13435 .It Sy OBJC_INCLUDE_PATH Ns
13436 Each variable's value is a list of directories separated by a special character, much like
13438 in which to look for header files.
13439 The special character,
13440 .Va PATH_SEPARATOR ,
13441 is target-dependent and determined at GCC build time.
13442 For Microsoft Windows-based targets it is a semicolon, and for almost all other targets it is a colon.
13445 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.
13450 This environment variable is used regardless of which language is being preprocessed.
13452 The remaining environment variables apply only when preprocessing the particular language indicated.
13453 Each specifies a list of directories to be searched as if specified with
13455 but after any paths given with
13457 options on the command line.
13459 In all these variables, an empty element instructs the compiler to search its current working directory.
13460 Empty elements can appear at the beginning or end of a path.
13461 For instance, if the value of
13464 .Va :/special/include ,
13465 that has the same effect as
13466 .Sy -I. -I/special/include .
13468 .It Sy DEPENDENCIES_OUTPUT Ns
13469 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.
13470 System header files are ignored in the dependency output.
13473 .Sy DEPENDENCIES_OUTPUT
13474 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.
13475 Or the value can have the form
13479 in which case the rules are written to file
13483 as the target name.
13485 In other words, this environment variable is equivalent to combining the options
13493 .It Sy SUNPRO_DEPENDENCIES Ns
13494 This variable is the same as
13495 .Sy DEPENDENCIES_OUTPUT
13496 (see above), except that system header files are not ignored, so it implies
13500 However, the dependence on the main input file is omitted.
13502 .It Sy CPP_RESTRICTED Ns
13503 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).
13507 For instructions on reporting bugs, see
13508 .Lk http://gcc.gnu.org/bugs.html .
13514 needs to build supplementary stub code for constructors to work.
13515 On multi-libbed systems,
13517 must select the correct support libraries to link against.
13518 Failing to supply the correct flags may lead to subtle defects.
13519 Supplying them in cases where they are not necessary is innocuous.
13523 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
13532 See the Info entry for
13535 .Lk http://gcc.gnu.org/onlinedocs/gcc/Contributors.html ,
13536 for contributors to GCC.
13538 Copyright (c) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
13540 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).
13541 A copy of the license is included in the gfdl(7) man page.
13543 (a) The FSF's Front-Cover Text is:
13547 (b) The FSF's Back-Cover Text is:
13549 You have freedom to copy and modify this GNU Manual, like GNU software.
13550 Copies published by the Free Software Foundation raise funds for GNU development.