If the description for a particular option does not mention a source language, you can use that option with all supported languages.
The gcc program accepts options and filenames as operands. Many options have multi-letter names; therefore, multiple single-letter options may not be grouped. You can mix options and other arguments. Order does matter when you use several options of the same kind; for example, if you specify ‘-L’ more than once, the directories are searched in the order specified.
Many options have long names starting with ‘-f’ or with ‘-W’ (for example, ‘-fstrength-reduce’ or ‘-Wformat’). Names often have positive and negative forms (the negative form of ‘-ffoo’ would be ‘-fno-foo’); this documentation generally discusses only one of the forms, whichever one not being default.
For each list of options, see the corresponding documentation for more details.
-c -S -E -o
file
-pipe -v -x language
-ansi -flagng-isoc9x
-fallow-single-precision -fcond-mismatch -fno-asm -fno-builtin
-ffreestanding -fhosted -fsigned-bitfields -fsigned-char -funsigned-bitfields
-funsigned-char -fwritable-strings -traditional -traditional-cpp
-trigraphs
-fno-access-control -fall-virtual
-fdollars-in-identifiers -felide-constructors -fenum-int-equiv
-fexternal-templates -ffor-scope -fno-for-scope -fhandle-signatures
-fmemoize-lookups -fname-mangling-version-n -fno-default-inline -fno-gnu-keywords
-fnonnull-objects -fguiding-decls -foperator-names -fstrict-prototype
-fthis-is-variable -ftemplate-depth-n -nostdinc++ -traditional
-fsyntax-only -pedantic -pedantic-errors
-w -W -Wall -Waggregate-return -Wbad-function-cast -Wcast-align
-Wcast-qual -Wchar-subscript –Wcomment -Wconversion -Werror -Wformat
-Wid-clash-len -Wimplicit -Wimplicit-int -Wimplicit-function-declarations
-Wimport -Winline -Wlarger-than-len -Wmain -Wmissing-declarations
-Wmissing-prototypes -Wnested-externs -Wno-import -Wold-style-cast
-Woverloaded-virtual -Wparentheses -Wpointer-arith -Wredundant-decls -Wreorder
-Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes -Wswitch –Wsynth
-Wtemplate-debugging -Wtraditional –Wtrigraphs -Wundef -Wuninitialized
-Wunused -Wwrite-strings -Wunknown-pragmas
-a -ax -dletters
-fpretend-float -fprofile-arcs -ftest-coverage -g -glevel
-gcoff -gdwarf -gdwarf-1 -gdwarf+1 -gdwarf-2 -ggdb
-gstabs -gstabs+ -gxcoff -gxcoff+ -p
-pg -print-file-name=library -print-libgcc-file-name
-print-prog-name=program -print-search-dirs -save-temps
-fbranch-probabilities -fcaller-saves
-fcse-follow-jumps -fcse-skip-blocks -fdelayed-branch -fexpensive-optimizations
-ffast-math -ffloat-store -fforce-addr -fforce-mem -ffunction-sections
-finline-functions -fkeep-inline-functions -fno-default-inline -fno-defer-pop
-fno-function-cse -fno-inline -fno-peephole -fomit-frame-pointer
-fregmove -frerun-cse-after-loop -frerun-loop-opt -fschedule-insns
-fschedule-insns2 -fshorten-lifetimes -fstrength-reduce -fthread-jumps
-funroll-all-loops -funroll-loops -fgcse -fmove-all-variables -freduce-all-givs
-O -O0 -O1 -O2 -O3 Os
-Aquestion(answer)
-C -dD -dM -dN -Dmacro[=defn]
-E -H -idirafter
dir
-include file -imacros file
-iprefix file -iwithprefix
dir
-iwithprefixbefore dir
-isystem dir
-M -MD -MM -MMD -MG -nostdinc -P
-trigraphs -undef
-Umacro -Wp, option
-Wa, option
object-file-name
-llibrary
-nostartfiles -nodefaultlibs
-nostdlib
-s -static
-shared -symbolic
-Wl,option
-Xlinker option
-u symbol
-Bprefix
-Idir -I- -Ldir
-specs=file
-bmachine
-Vversion
AMD29K options (see AMD29K options)
-m29000 -m29050 -mbw -mnbw -mdw -mndw -mlarge -mnormal -msmall -mkernel-registers -mno-reuse-arg-regs -mno-stack-check -mno-storem-bug -mreuse-arg-regs -msoft-float -mstack-check -mstorem-bug -muser-registers
ARC options (see ARC options)
-EB –EL –mmangle-cpu–mcpu=cpu
–mtext=text section
–mdata=data section –mrodata=readonly
data section
ARM options (see ARM options)
-mapcs-frame -mno-apcs-frame -mapcs-26 -mapcs-32 -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 -mshort-load-bytes -mno-short-load-bytes -mshort-load-words -mno-short-load -msoft-float -mhard-float -mfpe -mthumb-interwork -mno-thumb-interwork -mcpu= -march= -mfpe= -mstructure-size-boundary= -mbsd -mxopen -mno-symrename -mnop-fun-dllimport -mno-nop-fun-dllimport
ARM Thumb options (see ARM Thumb options)
-mtpcs-frame -mno-tpcs-frame -mtpcs-leaf-frame -mno-tpcs-leaf-frame -mlittle-endian -mbig-endian -mthumb-interwork -mno-thumb-interwork -mstructure-size-boundary= -mnop-fun-dllimport -mno-nop-fun-dllimport -mcallee-super-interworking -m-callee-super-interworking -mcaller-super-interworking -mno-caller-super-interworking
Clipper options (see Clipper options)
-mc300 -mc400
Convex options (see Convex options)
-mc1 -mc2 -mc32 -mc34 -mc38 -margcount
-mnoargcount
-mlong32 -mlong64 -mvolatile-cache
-mvolatile-nocache
DEC Alpha options (see DEC Alpha options)
-mfp-regs -mno-fp-regs -mno-soft-float -msoft-float -malpha-as -mgas -mieee -mieee-with-inexact -mieee-conformant -mfp-trap--mode=mode -mfp-rounding-mode=mode -mtrap-precision=mode -mbuild-constants -mcpu=cpu type -mbwx -mno-bwx -mcix -mno-cix -mmax -mno-max -mmemory-latency=time
Hitachi H8/300 options (see H8/300 options)
-mrelax -mh -ms -mint32 -malign-300
Hitachi SH options (see SH options)
-m1 -m2 -m3 -mb -ml -mrelax
HPPA options (see HPPA options)
-mbig-switch -mdisable-fpregs -mdisable-indexing -mfast-indirect-calls -mgas -mjump-in-delay -mlong-load-store –mno-big-switch -mno-disable-fpregs -mno-disable-indexing -mfast-indirect-calls -mno-gas -mno-jump-in-delay -mno-long-load-store -mno-portable-runtime -mno-soft-float -mno-space -mno-space-regs -msoft-float -mpa-risc-1-0 -mpa-risc-1-1 -mportable-runtime -mschedule=list -mspace -mspace-regs
IBM RS/6000 and PowerPC 0ptions (see IBM RS/6000 and PowerPC options)
-mcpu=cpu type -mtune=cputype -mpower -mno-power -mpower2 -mno-power2 -mpowerpc -mno-powerpc -mpowerpc-gpopt -mno-powerpc-gpopt -mpowerpc-gfxopt -mno-powerpc-gfxopt -mnew-mnemonics -mno-new-mnemonics -mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc -mxl-call -mno-xl-call -mthreads -mpe -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 -mtraceback -mno-traceback -mlittle -mlittle-endian -mbig -mbig-endian -mcall-aix -mcall-sysv -mprototype -mno-prototype -msim -mmvme -memb –mads –myellowknife -msdata -msdata=opt -G num
IBM RT options (see IBM RT options)
-mcall-lib-mul -mfp-arg-in-fpregs
-mfp-arg-in-gregs
-mfull-fp-blocks -mhc-struct-return
-min-line-mul
-mminimum-fp-blocks -mnohc-struct-return
Intel 386 options (see Intel 386 options)
-mcpu=cpu type -march=cpu
type -mieee-fp -mno-fancy-math-387 -mno-fp-ret-in-387 -msoft-float
-msvr3-shlib -mno-wide-multiply -mrtd -malign-double
-mreg-alloc=list -mregparm=num
-malign-jumps=num
-malign-loops=num -malign-functions=num
Intel 960 options (see Intel 960 options)
-mcpu type -masm-compat -mclean-linkage -mcode-align -mcomplex-addr -mleaf-procedures -mic-compat -mic2.0-compat -mic3.0-compat -mintel-asm -mno-clean-linkage -mno-code-align -mno-complex-addr -mno-leaf-procedures -mno-old-align -mno-strict-align -mno-tail-call -mnumerics -mold-align -msoft-float -mstrict-align -mtail-call
Matsushita MN10300 options (see MN10200 options)
-mrelax
Matsushita MN10300 options (see MN10300 options)
-mmult-bug -mno-mult-bug -mrelax
MIPS options (see MIPS options)
-mabicalls -mcpu=cpu type -membedded-data -membedded-pic -mfp32 -mfp64 -mgas -mgp32 -mgp64 -mgpopt -mhalf-pic -mhard-float -mint64 -mips1 -mips2 -mips3 -mlong64 -mlong-calls -mmemcpy -mmips-as -mmips-tfile -mno-abicalls -mno-embedded-data -mno-embedded-pic -mno-gpopt -mno-long-calls -mno-memcpy -mno-mips-tfile -mno-rnames -mno-stats -mrnames -msoft-float -m4650 -msingle-float -mmad -mstats -EL -EB -G num -nocpp
Mitsubishi D10V options (see D10V options)
-mint16 -mint32 -maddac3 -mno-addac3 -mdouble32 -mdouble64 -maccum -mno-accum -msim -masm-optimize -mno-asm-optimize -msmall-insns -mno-small-insns -mbranch-cost=n -mcond-exec=n -mno-cond-move -mcond-move
Mitsubishi M32R/D/X options (see M32R/D/X options)
-mcode-model=small -mcode-model=medium -mcode-model=large -msdata=none –msdata=sdata –msdata=use –G num
Motorola 68K options (see M68K options)
-m68000 -m68020 -m68020-40 –m68020-60 -m68030 -m68040 -m68060 -mcpu32 -m5200 -m68881 -mbitfield -mc68000 -mc68020 -mnobitfield -mrtd -mshort -msoft-float –malign-int
Motorola 88K options (see M88K options)
-m88000 -m88100 -m88110 -mbig-pic -mcheck-zero-division -mhandle-large-shift -midentify-revision -mno-check-zero-division -mno-ocs-debug-info -mno-ocs-frame-position -mno-optimize-arg-area -mno-serialize-volatile -mno-underscores -mocs-debug-info -mocs-frame-position -moptimize-arg-area -mserialize-volatile -mshort-data-num -msvr3 -msvr4 -mtrap-large-shift -muse-div-instruction -mversion-03.00 -mwarn-passed-structs
NEC V850 options (see NEC V850 options)
-mlong-calls -mno-long-calls -mep -mno-ep -mprolog-function -mno-prolog-function -mspace -mtda=n -msda=n -mzda=n -mv850 -mbig-switch -mapp-regs -mno-app-regs
SPARC options (see SPARC options)
-mcpu=cpu type -mtune=cpu type -mcmodel=code model -malign-jumps=num -malign-loops=num -malign-functions=num -m32 -m64 -mapp-regs -mno-app-regs -mbroken-saverestore -mcypress -mepilogue -mno-epilogue -mflat -mno-flat -mfpu -hmno-fpu -mhard-float -mhard-quad-float -mimpure-text -mliveg0 -mno-impure-text -mno-stack-bias -mno-unaligned-doubles -msoft-float -msoft-quad-float -msparclite -mstack-bias -msupersparc -munaligned-doubles -mv8
System V options (see System V options)
-Qy -Qn -YP,paths -Ym,dir
VAX options (see VAX options)
-mg -mgnu -munix
-mz8001
Generate code for the segmented variant of the Z8000 architecture. (Without this option, gcc generates unsegmented Z8000 code suitable, for example, for the Z8002.)
-fcall-saved-reg -fcall-used-reg
-fexceptions -ffixed-reg -finhibit-size-directive –fcheck-memory-usage
-fprefix-function-name -fno-common -fno-ident -fno-gnu-linker -fpcc-struct-return
-fpic -fPIC -freg-struct-return -fshared-data -fshort-enums -fshort-double
–fvolatile -fvolatile-global -funaligned-pointers -funaligned-struct-hack
-fverbose-asm -fpack-struct –fstack-check +e0 +e1 -fargument-alias -fargument-noalias
-fargument-noalias-global