Next: , Up: Invoking GCC


3.1 Option Summary

Here is a summary of all the options, grouped by type. Explanations are in the following sections.

Overall Options
See Options Controlling the Kind of Output.
          -c  -S  -E  -o file  -combine -pipe  -pass-exit-codes  
          
          -ObjC (APPLE ONLY) -ObjC++ (APPLE ONLY) 
          
          -arch arch (APPLE ONLY) 
          -Xarch_arch option (APPLE ONLY) 
          
          
          -fsave-repository=file 
          -x language  -v  -###  --help  --target-help  --version @file
     

C Language Options
See Options Controlling C Dialect.
          -ansi  -std=standard  -fgnu89-inline 
          -aux-info filename 
          
          -faltivec (APPLE ONLY) 
          
          -fasm-blocks (APPLE ONLY) 
          -fno-asm  -fno-builtin  -fno-builtin-function 
          -fhosted  -ffreestanding -fopenmp -fms-extensions 
          -trigraphs  -no-integrated-cpp  -traditional  -traditional-cpp 
          -fallow-single-precision  -fcond-mismatch 
          
          -fconstant-cfstrings (APPLE ONLY) 
          
          -fnon-lvalue-assign (APPLE ONLY) 
          
          -fno-nested-functions 
          
          -fpch-preprocess (APPLE ONLY) 
          -fsigned-bitfields  -fsigned-char 
          
          -Wno-#warnings (APPLE ONLY) 
          
          -Wextra-tokens (APPLE ONLY) 
          
          -Wnewline-eof (APPLE ONLY) 
          
          -Wno-altivec-long-deprecated (APPLE ONLY)
          
          -funsigned-bitfields  -funsigned-char  -fwritable-strings
     

C++ Language Options
See Options Controlling C++ Dialect.
          -fabi-version=n  -fno-access-control  -fcheck-new 
          -fconserve-space  -ffriend-injection 
          -fno-elide-constructors 
          -fno-enforce-eh-specs 
          -ffor-scope  -fno-for-scope  -fno-gnu-keywords 
          -fno-implicit-templates 
          -fno-implicit-inline-templates 
          -fno-implement-inlines  -fms-extensions 
          -fno-nonansi-builtins  -fno-operator-names 
          -fno-optional-diags  -fpermissive 
          -frepo  -fno-rtti  -fstats  -ftemplate-depth-n 
          -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ 
          -fno-default-inline  -fvisibility-inlines-hidden 
          
          -fvisibility-ms-compat
          -Wabi  -Wctor-dtor-privacy 
          -Wnon-virtual-dtor  -Wreorder 
          -Weffc++  -Wno-deprecated  -Wstrict-null-sentinel 
          -Wno-non-template-friend  -Wold-style-cast 
          -Woverloaded-virtual  -Wno-pmf-conversions 
          -Wsign-promo
     

Objective-C and Objective-C++ Language Options
See Options Controlling Objective-C and Objective-C++ Dialects.
          -fconstant-string-class=class-name 
          -fgnu-runtime  -fnext-runtime 
          -fno-nil-receivers 
          -fobjc-call-cxx-cdtors 
          -fobjc-direct-dispatch 
          
          -fobjc-sjlj-exceptions 
          -fobjc-gc 
          -freplace-objc-classes 
          -fzero-link 
          -gen-decls 
          -Wassign-intercept 
          -Wno-protocol  -Wselector 
          
          -Wno-property-assign-default 
          -Wstrict-selector-match 
          -Wundeclared-selector
     

Language Independent Options
See Options to Control Diagnostic Messages Formatting.
          -fmessage-length=n  
          -fdiagnostics-show-location=[once|every-line]  
          -fdiagnostics-show-option
     

Warning Options
See Options to Request or Suppress Warnings.
          -fsyntax-only  -pedantic  -pedantic-errors 
          -w  -Wextra  -Wall  -Waddress  -Waggregate-return -Wno-attributes 
          -Wc++-compat -Wcast-align  -Wcast-qual  -Wchar-subscripts  -Wcomment 
          -Wconversion  -Wno-deprecated-declarations 
          -Wdisabled-optimization  -Wno-div-by-zero  -Wno-endif-labels 
          -Werror  -Werror=* -Werror-implicit-function-declaration 
          -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 
          -Wno-format-extra-args -Wformat-nonliteral 
          -Wformat-security  -Wformat-y2k 
          -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int 
          -Wimport  -Wno-import  -Winit-self  -Winline 
          -Wno-int-to-pointer-cast 
          -Wno-invalid-offsetof  -Winvalid-pch 
          -Wlarger-than-len  -Wunsafe-loop-optimizations  -Wlong-long 
          -Wmain  -Wmissing-braces  -Wmissing-field-initializers 
          -Wmissing-format-attribute  -Wmissing-include-dirs 
          -Wmissing-noreturn 
          
          -Wmost (APPLE ONLY) 
          -Wno-multichar  -Wnonnull  -Wno-overflow 
          -Woverlength-strings  -Wpacked  -Wpadded 
          -Wparentheses  -Wpointer-arith  -Wno-pointer-to-int-cast 
          -Wredundant-decls 
          -Wreturn-type  -Wsequence-point  -Wshadow 
          -Wsign-compare  -Wstack-protector 
          -Wstrict-aliasing -Wstrict-aliasing=2 
          -Wstrict-overflow -Wstrict-overflow=n 
          -Wswitch  -Wswitch-default  -Wswitch-enum 
          -Wsystem-headers  -Wtrigraphs  -Wundef  -Wuninitialized 
          -Wunknown-pragmas  -Wno-pragmas -Wunreachable-code 
          -Wunused  -Wunused-function  -Wunused-label  -Wunused-parameter 
          -Wunused-value  -Wunused-variable  -Wvariadic-macros 
          -Wvolatile-register-var  -Wwrite-strings
     

C-only Warning Options
          -Wbad-function-cast  -Wmissing-declarations 
          -Wmissing-prototypes  -Wnested-externs  -Wold-style-definition 
          -Wstrict-prototypes  -Wtraditional 
          -Wdeclaration-after-statement -Wno-discard-qual -Wno-pointer-sign
     

Debugging Options
See Options for Debugging Your Program or GCC.
          -dletters  -dumpspecs  -dumpmachine  -dumpversion 
          -fdump-noaddr -fdump-unnumbered  -fdump-translation-unit[-n] 
          -fdump-class-hierarchy[-n] 
          -fdump-ipa-all -fdump-ipa-cgraph 
          -fdump-tree-all 
          -fdump-tree-original[-n]  
          -fdump-tree-optimized[-n] 
          -fdump-tree-inlined[-n] 
          -fdump-tree-cfg -fdump-tree-vcg -fdump-tree-alias 
          -fdump-tree-ch 
          -fdump-tree-ssa[-n] -fdump-tree-pre[-n] 
          -fdump-tree-ccp[-n] -fdump-tree-dce[-n] 
          -fdump-tree-gimple[-raw] -fdump-tree-mudflap[-n] 
          -fdump-tree-dom[-n] 
          -fdump-tree-dse[-n] 
          -fdump-tree-phiopt[-n] 
          -fdump-tree-forwprop[-n] 
          -fdump-tree-copyrename[-n] 
          -fdump-tree-nrv -fdump-tree-vect 
          -fdump-tree-sink 
          -fdump-tree-sra[-n] 
          -fdump-tree-salias 
          -fdump-tree-fre[-n] 
          -fdump-tree-vrp[-n] 
          -ftree-vectorizer-verbose=n 
          -fdump-tree-storeccp[-n] 
          
          -flimit-debug-info 
          -feliminate-dwarf2-dups -feliminate-unused-debug-types 
          -feliminate-unused-debug-symbols -femit-class-debug-always 
          
          -fmem-report -fopt-diary -fprofile-arcs 
          -frandom-seed=string -fsched-verbose=n 
          -ftest-coverage  -ftime-report -fvar-tracking 
          -g  -glevel  -gcoff -gdwarf-2 
          -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ 
          -p  -pg  -print-file-name=library  -print-libgcc-file-name 
          -print-multi-directory  -print-multi-lib 
          -print-prog-name=program  -print-search-dirs  -Q 
          -save-temps  -time
     

Optimization Options
See Options that Control Optimization.
          -falign-functions=n  -falign-jumps=n 
          -falign-labels=n  -falign-loops=n  
          
          -falign-loops-max-skip=n -falign-jumps-max-skip=n 
          -fbounds-check -fmudflap -fmudflapth -fmudflapir 
          -fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize 
          -fbranch-target-load-optimize2 -fbtr-bb-exclusive 
          
          -fcaller-saves  -fcprop-registers  -fcreate-profile -fcse-follow-jumps 
          -fcse-skip-blocks  -fcx-limited-range  -fdata-sections 
          -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining 
          -fexpensive-optimizations  -ffast-math  -ffloat-store 
          -fforce-addr  -ffunction-sections 
          -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload 
          -fcrossjumping  -fif-conversion  -fif-conversion2 
          -finline-functions  -finline-functions-called-once 
          -finline-limit=n  -fkeep-inline-functions 
          -fkeep-static-consts  -fmerge-constants  -fmerge-all-constants 
          -fmodulo-sched -fno-branch-count-reg 
          -fno-default-inline  -fno-defer-pop -fmove-loop-invariants 
          -fno-function-cse  -fno-guess-branch-probability 
          -fno-inline  -fno-math-errno  -fno-peephole  -fno-peephole2 
          -funsafe-math-optimizations  -funsafe-loop-optimizations  -ffinite-math-only 
          -fno-toplevel-reorder -fno-trapping-math  -fno-zero-initialized-in-bss 
          
          -mstackrealign 
          -fomit-frame-pointer  -foptimize-register-move 
          -foptimize-sibling-calls  -fprefetch-loop-arrays 
          -fprofile-generate -fprofile-use 
          -fregmove  -frename-registers 
          -freorder-blocks  -freorder-blocks-and-partition -freorder-functions 
          -frerun-cse-after-loop 
          -frounding-math -frtl-abstract-sequences 
          -fschedule-insns  -fschedule-insns2 
          -fno-sched-interblock  -fno-sched-spec  -fsched-spec-load 
          -fsched-spec-load-dangerous  
          -fsched-stalled-insns=n -fsched-stalled-insns-dep=n 
          -fsched2-use-superblocks 
          -fsched2-use-traces -fsee -freschedule-modulo-scheduled-loops 
          -fsection-anchors  -fsignaling-nans  -fsingle-precision-constant 
          -fstack-protector  -fstack-protector-all 
          -fstrict-aliasing  -fstrict-overflow  -ftracer  -fthread-jumps 
          -funroll-all-loops  -funroll-loops  -fpeel-loops 
          -fsplit-ivs-in-unroller -funswitch-loops 
          -fvariable-expansion-in-unroller 
          -ftree-pre  -ftree-ccp  -ftree-dce -ftree-loop-optimize 
          -ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts 
          -ftree-dominator-opts -ftree-dse -ftree-copyrename -ftree-sink 
          -ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize 
          
          -ftree-vect-loop-version -ftree-salias -fuse-profile -fipa-pta -fweb 
          -ftree-copy-prop -ftree-store-ccp -ftree-store-copy-prop -fwhole-program 
          --param name=value
          
          -O  -O0  -O1  -O2  -O3  -Os -Oz (APPLE ONLY) -fast (APPLE ONLY)
     

Preprocessor Options
See Options Controlling the Preprocessor.
          -Aquestion=answer 
          -A-question[=answer] 
          -C  -dD  -dI  -dM  -dN 
          -Dmacro[=defn]  -E  -H 
          -idirafter dir 
          -include file  -imacros file 
          -iprefix file  -iwithprefix dir 
          -iwithprefixbefore dir  -isystem dir 
          -imultilib dir -isysroot dir 
          -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  
          -P  -fworking-directory  -remap 
          -trigraphs  -undef  -Umacro  -Wp,option 
          -Xpreprocessor option
     

Assembler Option
See Passing Options to the Assembler.
          -Wa,option  -Xassembler option
     

Linker Options
See Options for Linking.
          object-file-name  -llibrary 
          -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic 
          -s  -static  -static-libgcc  -shared  -shared-libgcc  -symbolic 
          -Wl,option  -Xlinker option 
          -u symbol
     

Directory Options
See Options for Directory Search.
          -Bprefix  -Idir  -iquotedir  -Ldir
          -specs=file  -I- --sysroot=dir
     

Target Options
See Target Options.
          -V version  -b machine
     

Machine Dependent Options
See Hardware Models and Configurations.

ARM Options

          -mapcs-frame  -mno-apcs-frame 
          -mabi=name 
          -mapcs-stack-check  -mno-apcs-stack-check 
          -mapcs-float  -mno-apcs-float 
          -mapcs-reentrant  -mno-apcs-reentrant 
          -msched-prolog  -mno-sched-prolog 
          -mlittle-endian  -mbig-endian  -mwords-little-endian 
          -mfloat-abi=name  -msoft-float  -mhard-float  -mfpe 
          -mthumb-interwork  -mno-thumb-interwork 
          -mcpu=name  -march=name  -mfpu=name  
          -mstructure-size-boundary=n 
          -mabort-on-noreturn 
          -mlong-calls  -mno-long-calls 
          -msingle-pic-base  -mno-single-pic-base 
          -mpic-register=reg 
          -mnop-fun-dllimport 
          -mcirrus-fix-invalid-insns -mno-cirrus-fix-invalid-insns 
          -mpoke-function-name 
          -mthumb  -marm 
          -mtpcs-frame  -mtpcs-leaf-frame 
          -mcaller-super-interworking  -mcallee-super-interworking 
          -mtp=name
     

CRX Options

          -mmac -mpush-args
     

Darwin Options

          -all_load  -allowable_client  -arch  -arch_errors_fatal 
          -arch_only  -bind_at_load  -bundle  -bundle_loader 
          -client_name  -compatibility_version  -current_version 
          -dead_strip 
          -dependency-file  -dylib_file  -dylinker_install_name 
          -dynamic  -dynamiclib  -exported_symbols_list 
          -filelist  -flat_namespace  -force_cpusubtype_ALL 
          -force_flat_namespace  -headerpad_max_install_names 
          
          -iframework 
          -image_base  -init  -install_name  -keep_private_externs 
          -multi_module  -multiply_defined  -multiply_defined_unused 
          -noall_load   -no_dead_strip_inits_and_terms 
          -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit 
          -pagezero_size  -prebind  -prebind_all_twolevel_modules 
          -private_bundle  -read_only_relocs  -sectalign 
          -sectobjectsymbols  -whyload  -seg1addr 
          -sectcreate  -sectobjectsymbols  -sectorder 
          -segaddr -segs_read_only_addr -segs_read_write_addr 
          -seg_addr_table  -seg_addr_table_filename  -seglinkedit 
          -segprot  -segs_read_only_addr  -segs_read_write_addr 
          -single_module  -static  -sub_library  -sub_umbrella 
          -twolevel_namespace  -umbrella  -undefined 
          -unexported_symbols_list  -weak_reference_mismatches 
          -whatsloaded -F -gused -gfull -mmacosx-version-min=version 
          
          -mpascal-strings (APPLE ONLY) 
          -mkernel -mone-byte-bool 
          
          -Xarch_arch
     

i386 and x86-64 Options

          -mtune=cpu-type  -march=cpu-type 
          -mfpmath=unit 
          -masm=dialect  -mno-fancy-math-387 
          -mno-fp-ret-in-387  -msoft-float  -msvr3-shlib 
          -mno-wide-multiply  -mrtd  -malign-double 
          -mpreferred-stack-boundary=num 
          
          -mmmx  -msse  -msse2 -msse3 -mssse3 -m3dnow 
          -mthreads  -mno-align-stringops  -minline-all-stringops 
          -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double 
          -m96bit-long-double  -mregparm=num  -msseregparm 
          -mstackrealign 
          -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs 
          -mcmodel=code-model 
          -m32  -m64 -mlarge-data-threshold=num
     

PowerPC Options See RS/6000 and PowerPC Options.

RS/6000 and PowerPC Options

          -mcpu=cpu-type 
          -mtune=cpu-type 
          -mpower  -mno-power  -mpower2  -mno-power2 
          -mpowerpc  -mpowerpc64  -mno-powerpc 
          -maltivec  -mno-altivec 
          
          -mpim-altivec -mno-pim-altivec 
          -mpowerpc-gpopt  -mno-powerpc-gpopt 
          -mpowerpc-gfxopt  -mno-powerpc-gfxopt 
          -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mfprnd  -mno-fprnd 
          -mnew-mnemonics  -mold-mnemonics 
          -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc 
          -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe 
          -malign-power  -malign-natural 
          -msoft-float  -mhard-float  -mmultiple  -mno-multiple 
          -mstring  -mno-string  -mupdate  -mno-update 
          -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align 
          -mstrict-align  -mno-strict-align  -mrelocatable 
          -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib 
          -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian 
          -mdynamic-no-pic  -maltivec  -mswdiv 
          -mprioritize-restricted-insns=priority 
          -msched-costly-dep=dependence_type 
          -minsert-sched-nops=scheme 
          -mcall-sysv  -mcall-netbsd 
          -maix-struct-return  -msvr4-struct-return 
          -mabi=abi-type -msecure-plt -mbss-plt 
          -misel -mno-isel 
          -misel=yes  -misel=no 
          -mspe -mno-spe 
          -mspe=yes  -mspe=no 
          -mvrsave -mno-vrsave 
          -mmulhw -mno-mulhw 
          -mdlmzb -mno-dlmzb 
          -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double 
          -mprototype  -mno-prototype 
          -msim  -mmvme  -mads  -myellowknife  -memb  -msdata 
          -msdata=opt  -mvxworks  -mwindiss  -G num  -pthread
     

Code Generation Options
See Options for Code Generation Conventions.
          -fcall-saved-reg  -fcall-used-reg 
          -ffixed-reg  -fexceptions 
          -fnon-call-exceptions  -funwind-tables 
          -fasynchronous-unwind-tables 
          -finhibit-size-directive  -finstrument-functions 
          -fno-common  -fno-ident 
          -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE 
          -fno-jump-tables 
          -freg-struct-return  -fshort-enums 
          -fshort-double  -fshort-wchar 
          -fverbose-asm  -fpack-struct[=n]  -fstack-check 
          -fstack-limit-register=reg  -fstack-limit-symbol=sym 
          -fargument-alias  -fargument-noalias 
          -fargument-noalias-global  -fargument-noalias-anything
          -fleading-underscore  -ftls-model=model 
          -ftrapv  -fwrapv  -fbounds-check 
          -fvisibility