and register usage.
* Environment Variables:: Env vars that affect GCC.
* Precompiled Headers:: Compiling a header once, and using it many times.
-* Running Protoize:: Automatically adding or removing function prototypes.
@end menu
@c man begin OPTIONS
-Wchar-subscripts -Wclobbered -Wcomment @gol
-Wconversion -Wcoverage-mismatch -Wno-deprecated @gol
-Wno-deprecated-declarations -Wdisabled-optimization @gol
--Wdisallowed-function-list=@var{sym},@var{sym},@dots{} @gol
-Wno-div-by-zero -Wempty-body -Wenum-compare -Wno-endif-labels @gol
-Werror -Werror=* @gol
-Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
-print-multi-directory -print-multi-lib @gol
-print-prog-name=@var{program} -print-search-dirs -Q @gol
-print-sysroot -print-sysroot-headers-suffix @gol
--save-temps -time}
+-save-temps -save-temps=cwd -save-temps=obj -time}
@item Optimization Options
@xref{Optimize Options,,Options that Control Optimization}.
-fdata-sections -fdce -fdce @gol
-fdelayed-branch -fdelete-null-pointer-checks -fdse -fdse @gol
-fearly-inlining -fexpensive-optimizations -ffast-math @gol
--ffinite-math-only -ffloat-store -fforward-propagate @gol
--ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
+-ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
+-fforward-propagate -ffunction-sections @gol
+-fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
-fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-matrix-reorg -fipa-pta @gol
-freciprocal-math -fregmove -frename-registers -freorder-blocks @gol
-freorder-blocks-and-partition -freorder-functions @gol
-frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
--frounding-math -frtl-abstract-sequences -fsched2-use-superblocks @gol
+-frounding-math -fsched2-use-superblocks @gol
-fsched2-use-traces -fsched-spec-load -fsched-spec-load-dangerous @gol
-fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
-fschedule-insns -fschedule-insns2 -fsection-anchors -fsee @gol
@emph{AVR Options}
@gccoptlist{-mmcu=@var{mcu} -msize -minit-stack=@var{n} -mno-interrupts @gol
--mcall-prologues -mno-tablejump -mtiny-stack -mint8}
+-mcall-prologues -mtiny-stack -mint8}
@emph{Blackfin Options}
@gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
-m96bit-long-double -mregparm=@var{num} -msseregparm @gol
-mveclibabi=@var{type} -mpc32 -mpc64 -mpc80 -mstackrealign @gol
-momit-leaf-frame-pointer -mno-red-zone -mno-tls-direct-seg-refs @gol
--mcmodel=@var{code-model} @gol
+-mcmodel=@var{code-model} -mabi=@var{name} @gol
-m32 -m64 -mlarge-data-threshold=@var{num} @gol
-mfused-madd -mno-fused-madd -msse2avx}
@emph{x86-64 Options}
See i386 and x86-64 Options.
+@emph{i386 and x86-64 Windows Options}
+@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
+-mnop-fun-dllimport -mthread -mwin32 -mwindows}
+
@emph{Xstormy16 Options}
@gccoptlist{-msim}
This option is implied by @option{-pedantic}, and can be disabled with
@option{-Wno-overlength-strings}.
-
-@item -Wdisallowed-function-list=@var{sym},@var{sym},@dots{}
-@opindex Wdisallowed-function-list
-
-If any of @var{sym} is called, GCC will issue a warning. This can be useful
-in enforcing coding conventions that ban calls to certain functions, for
-example, @code{alloca}, @code{malloc}, etc.
@end table
@node Debugging Options
@item -fno-merge-debug-strings
@opindex fmerge-debug-strings
@opindex fno-merge-debug-strings
-Direct the linker to merge together strings which are identical in
-different object files. This is not supported by all assemblers or
-linker. This decreases the size of the debug information in the
-output file at the cost of increasing link processing time. This is
-on by default.
+Direct the linker to not merge together strings in the debugging
+information which are identical in different object files. Merging is
+not supported by all assemblers or linkers. Merging decreases the size
+of the debug information in the output file at the cost of increasing
+link processing time. Merging is enabled by default.
@item -fdebug-prefix-map=@var{old}=@var{new}
@opindex fdebug-prefix-map
dependence info.
@item -save-temps
+@itemx -save-temps=cwd
@opindex save-temps
Store the usual ``temporary'' intermediate files permanently; place them
in the current directory and name them based on the source file. Thus,
The corresponding intermediate file may be obtained by renaming the
source file before using @option{-save-temps}.
+If you invoke GCC in parallel, compiling several different source
+files that share a common base name in different subdirectories or the
+same source file compiled for multiple output destinations, it is
+likely that the different parallel compilers will interfere with each
+other, and overwrite the temporary files. For instance:
+
+@smallexample
+gcc -save-temps -o outdir1/foo.o indir1/foo.c&
+gcc -save-temps -o outdir2/foo.o indir2/foo.c&
+@end smallexample
+
+may result in @file{foo.i} and @file{foo.o} being written to
+simultaneously by both compilers.
+
+@item -save-temps=obj
+@opindex save-temps=obj
+Store the usual ``temporary'' intermediate files permanently. If the
+@option{-o} option is used, the temporary files are based on the
+object file. If the @option{-o} option is not used, the
+@option{-save-temps=obj} switch behaves like @option{-save-temps}.
+
+For example:
+
+@smallexample
+gcc -save-temps=obj -c foo.c
+gcc -save-temps=obj -c bar.c -o dir/xbar.o
+gcc -save-temps=obj foobar.c -o dir2/yfoobar
+@end smallexample
+
+would create @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
+@file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
+@file{dir2/yfoobar.o}.
+
@item -time
@opindex time
Report the CPU time taken by each subprocess in the compilation
contiguously by column, and the original loop iterates over rows,
potentially creating at each access a cache miss. This optimization
applies to all the languages supported by GCC and is not limited to
-Fortran.
+Fortran. To use this code transformation, GCC has to be configured
+with @option{--with-ppl} and @option{--with-cloog} to enable the
+Graphite loop transformation infrastructure.
@item -floop-strip-mine
Perform loop strip mining transformations on loops. Strip mining
ENDDO
@end smallexample
This optimization applies to all the languages supported by GCC and is
-not limited to Fortran.
+not limited to Fortran. To use this code transformation, GCC has to
+be configured with @option{--with-ppl} and @option{--with-cloog} to
+enable the Graphite loop transformation infrastructure.
@item -floop-block
Perform loop blocking transformations on loops. Blocking strip mines
which can be beneficial when @code{M} is larger than the caches,
because the innermost loop will iterate over a smaller amount of data
that can be kept in the caches. This optimization applies to all the
-languages supported by GCC and is not limited to Fortran.
+languages supported by GCC and is not limited to Fortran. To use this
+code transformation, GCC has to be configured with @option{--with-ppl}
+and @option{--with-cloog} to enable the Graphite loop transformation
+infrastructure.
@item -fcheck-data-deps
@opindex fcheck-data-deps
point. Use @option{-ffloat-store} for such programs, after modifying
them to store all pertinent intermediate computations into variables.
+@item -fexcess-precision=@var{style}
+@opindex fexcess-precision
+This option allows further control over excess precision on machines
+where floating-point registers have more precision than the IEEE
+@code{float} and @code{double} types and the processor does not
+support operations rounding to those types. By default,
+@option{-fexcess-precision=fast} is in effect; this means that
+operations are carried out in the precision of the registers and that
+it is unpredictable when rounding to the types specified in the source
+code takes place. When compiling C, if
+@option{-fexcess-precision=standard} is specified then excess
+precision will follow the rules specified in ISO C99; in particular,
+both casts and assignments cause values to be rounded to their
+semantic types (whereas @option{-ffloat-store} only affects
+assignments). This option is enabled by default for C if a strict
+conformance option such as @option{-std=c99} is used.
+
+@opindex mfpmath
+@option{-fexcess-precision=standard} is not implemented for languages
+other than C, and has no effect if
+@option{-funsafe-math-optimizations} or @option{-ffast-math} is
+specified. On the x86, it also has no effect if @option{-mfpmath=sse}
+or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
+semantics apply without excess precision, and in the latter, rounding
+is unpredictable.
+
@item -ffast-math
@opindex ffast-math
Sets @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
using C99's @code{FENV_ACCESS} pragma. This command line option
will be used to specify the default state for @code{FENV_ACCESS}.
-@item -frtl-abstract-sequences
-@opindex frtl-abstract-sequences
-It is a size optimization method. This option is to find identical
-sequences of code, which can be turned into pseudo-procedures and
-then replace all occurrences with calls to the newly created
-subroutine. It is kind of an opposite of @option{-finline-functions}.
-This optimization runs at RTL level.
-
@item -fsignaling-nans
@opindex fsignaling-nans
Compile code assuming that IEEE signaling NaNs may generate user-visible
@item max-cse-insns
The maximum instructions CSE process before flushing. The default is 1000.
-@item max-aliased-vops
-
-Maximum number of virtual operands per function allowed to represent
-aliases before triggering the alias partitioning heuristic. Alias
-partitioning reduces compile times and memory consumption needed for
-aliasing at the expense of precision loss in alias information. The
-default value for this parameter is 100 for -O1, 500 for -O2 and 1000
-for -O3.
-
-Notice that if a function contains more memory statements than the
-value of this parameter, it is not really possible to achieve this
-reduction. In this case, the compiler will use the number of memory
-statements as the value for @option{max-aliased-vops}.
-
-@item avg-aliased-vops
-
-Average number of virtual operands per statement allowed to represent
-aliases before triggering the alias partitioning heuristic. This
-works in conjunction with @option{max-aliased-vops}. If a function
-contains more than @option{max-aliased-vops} virtual operators, then
-memory symbols will be grouped into memory partitions until either the
-total number of virtual operators is below @option{max-aliased-vops}
-or the average number of virtual operators per memory statement is
-below @option{avg-aliased-vops}. The default value for this parameter
-is 1 for -O1 and -O2, and 3 for -O3.
-
@item ggc-min-expand
GCC uses a garbage collector to manage its own memory allocation. This
* H8/300 Options::
* HPPA Options::
* i386 and x86-64 Options::
+* i386 and x86-64 Windows Options::
* IA-64 Options::
* M32C Options::
* M32R/D Options::
the compiler generates code to handle function calls via function
pointers.
-@item -mnop-fun-dllimport
-@opindex mnop-fun-dllimport
-Disable support for the @code{dllimport} attribute.
-
@item -msingle-pic-base
@opindex msingle-pic-base
Treat the register used for PIC addressing as read-only, rather than
use the 32-bit ARM instruction set.
This option automatically enables either 16-bit Thumb-1 or
mixed 16/32-bit Thumb-2 instructions based on the @option{-mcpu=@var{name}}
-and @option{-march=@var{name}} options.
+and @option{-march=@var{name}} options. This option is not passed to the
+assembler. If you want to force assembler files to be interpreted as Thumb code,
+either add a @samp{.thumb} directive to the source or pass the @option{-mthumb}
+option directly to the assembler by prefixing it with @option{-Wa}.
@item -mtpcs-frame
@opindex mtpcs-frame
Functions prologues/epilogues expanded as call to appropriate
subroutines. Code size will be smaller.
-@item -mno-tablejump
-@opindex mno-tablejump
-Do not generate tablejump insns which sometimes increase code size.
-
@item -mtiny-stack
@opindex mtiny-stack
Change only the low 8 bits of the stack pointer.
A deprecated synonym for @option{-mtune}.
@item -mfpmath=@var{unit}
-@opindex march
+@opindex mfpmath
Generate floating point arithmetics for selected unit @var{unit}. The choices
for @var{unit} are:
@option{-funsafe-math-optimizations} have to be enabled. A SVML or ACML ABI
compatible library will have to be specified at link time.
+@item -mabi=@var{name}
+@opindex mabi
+Generate code for the specified calling convention. Permissible values
+are: @samp{sysv} for the ABI used on GNU/Linux and other systems and
+@samp{ms} for the Microsoft ABI. The default is to use the Microsoft
+ABI when targeting Windows. On all other systems, the default is the
+SYSV ABI. You can control this behavior for a specific function by
+using the function attribute @samp{ms_abi}/@samp{sysv_abi}.
+@xref{Function Attributes}.
+
@item -mpush-args
@itemx -mno-push-args
@opindex mpush-args
In the future, we may cause GCC to ignore all longcall specifications
when the linker is known to generate glue.
+@item -mtls-markers
+@itemx -mno-tls-markers
+@opindex mtls-markers
+@opindex mno-tls-markers
+Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
+specifying the function argument. The relocation allows ld to
+reliably associate function call with argument setup instructions for
+TLS optimization, which in turn allows gcc to better schedule the
+sequence.
+
@item -pthread
@opindex pthread
Adds support for multithreading with the @dfn{pthreads} library.
These are listed under @xref{i386 and x86-64 Options}.
+@node i386 and x86-64 Windows Options
+@subsection i386 and x86-64 Windows Options
+@cindex i386 and x86-64 Windows Options
+
+These additional options are available for Windows targets:
+
+@table @gcctabopt
+@item -mconsole
+@opindex mconsole
+This option is available for Cygwin and MinGW targets. It
+specifies that a console application is to be generated, by
+instructing the linker to set the PE header subsystem type
+required for console applications.
+This is the default behaviour for Cygwin and MinGW targets.
+
+@item -mcygwin
+@opindex mcygwin
+This option is available for Cygwin targets. It specifies that
+the Cygwin internal interface is to be used for predefined
+preprocessor macros, C runtime libraries and related linker
+paths and options. For Cygwin targets this is the default behaviour.
+This option is deprecated and will be removed in a future release.
+
+@item -mno-cygwin
+@opindex mno-cygwin
+This option is available for Cygwin targets. It specifies that
+the MinGW internal interface is to be used instead of Cygwin's, by
+setting MinGW-related predefined macros and linker paths and default
+library options.
+This option is deprecated and will be removed in a future release.
+
+@item -mdll
+@opindex mdll
+This option is available for Cygwin and MinGW targets. It
+specifies that a DLL - a dynamic link library - is to be
+generated, enabling the selection of the required runtime
+startup object and entry point.
+
+@item -mnop-fun-dllimport
+@opindex mnop-fun-dllimport
+This option is available for Cygwin and MinGW targets. It
+specifies that the dllimport attribute should be ignored.
+
+@item -mthread
+@opindex mthread
+This option is available for MinGW targets. It specifies
+that MinGW-specific thread support is to be used.
+
+@item -mwin32
+@opindex mwin32
+This option is available for Cygwin and MinGW targets. It
+specifies that the typical Windows pre-defined macros are to
+be set in the pre-processor, but does not influence the choice
+of runtime library/startup code.
+
+@item -mwindows
+@opindex mwindows
+This option is available for Cygwin and MinGW targets. It
+specifies that a GUI application is to be generated by
+instructing the linker to set the PE header subsystem type
+appropriately.
+@end table
+
+See also under @ref{i386 and x86-64 Options} for standard options.
+
@node Xstormy16 Options
@subsection Xstormy16 Options
@cindex Xstormy16 Options
behavior for the options. For instance, if you use @option{-g} to
generate the precompiled header but not when using it, you may or may
not get debugging information for routines in the precompiled header.
-
-@node Running Protoize
-@section Running Protoize
-
-The program @code{protoize} is an optional part of GCC@. You can use
-it to add prototypes to a program, thus converting the program to ISO
-C in one respect. The companion program @code{unprotoize} does the
-reverse: it removes argument types from any prototypes that are found.
-
-When you run these programs, you must specify a set of source files as
-command line arguments. The conversion programs start out by compiling
-these files to see what functions they define. The information gathered
-about a file @var{foo} is saved in a file named @file{@var{foo}.X}.
-
-After scanning comes actual conversion. The specified files are all
-eligible to be converted; any files they include (whether sources or
-just headers) are eligible as well.
-
-But not all the eligible files are converted. By default,
-@code{protoize} and @code{unprotoize} convert only source and header
-files in the current directory. You can specify additional directories
-whose files should be converted with the @option{-d @var{directory}}
-option. You can also specify particular files to exclude with the
-@option{-x @var{file}} option. A file is converted if it is eligible, its
-directory name matches one of the specified directory names, and its
-name within the directory has not been excluded.
-
-Basic conversion with @code{protoize} consists of rewriting most
-function definitions and function declarations to specify the types of
-the arguments. The only ones not rewritten are those for varargs
-functions.
-
-@code{protoize} optionally inserts prototype declarations at the
-beginning of the source file, to make them available for any calls that
-precede the function's definition. Or it can insert prototype
-declarations with block scope in the blocks where undeclared functions
-are called.
-
-Basic conversion with @code{unprotoize} consists of rewriting most
-function declarations to remove any argument types, and rewriting
-function definitions to the old-style pre-ISO form.
-
-Both conversion programs print a warning for any function declaration or
-definition that they can't convert. You can suppress these warnings
-with @option{-q}.
-
-The output from @code{protoize} or @code{unprotoize} replaces the
-original source file. The original file is renamed to a name ending
-with @samp{.save} (for DOS, the saved filename ends in @samp{.sav}
-without the original @samp{.c} suffix). If the @samp{.save} (@samp{.sav}
-for DOS) file already exists, then the source file is simply discarded.
-
-@code{protoize} and @code{unprotoize} both depend on GCC itself to
-scan the program and collect information about the functions it uses.
-So neither of these programs will work until GCC is installed.
-
-Here is a table of the options you can use with @code{protoize} and
-@code{unprotoize}. Each option works with both programs unless
-otherwise stated.
-
-@table @code
-@item -B @var{directory}
-Look for the file @file{SYSCALLS.c.X} in @var{directory}, instead of the
-usual directory (normally @file{/usr/local/lib}). This file contains
-prototype information about standard system functions. This option
-applies only to @code{protoize}.
-
-@item -c @var{compilation-options}
-Use @var{compilation-options} as the options when running @command{gcc} to
-produce the @samp{.X} files. The special option @option{-aux-info} is
-always passed in addition, to tell @command{gcc} to write a @samp{.X} file.
-
-Note that the compilation options must be given as a single argument to
-@code{protoize} or @code{unprotoize}. If you want to specify several
-@command{gcc} options, you must quote the entire set of compilation options
-to make them a single word in the shell.
-
-There are certain @command{gcc} arguments that you cannot use, because they
-would produce the wrong kind of output. These include @option{-g},
-@option{-O}, @option{-c}, @option{-S}, and @option{-o} If you include these in
-the @var{compilation-options}, they are ignored.
-
-@item -C
-Rename files to end in @samp{.C} (@samp{.cc} for DOS-based file
-systems) instead of @samp{.c}. This is convenient if you are converting
-a C program to C++. This option applies only to @code{protoize}.
-
-@item -g
-Add explicit global declarations. This means inserting explicit
-declarations at the beginning of each source file for each function
-that is called in the file and was not declared. These declarations
-precede the first function definition that contains a call to an
-undeclared function. This option applies only to @code{protoize}.
-
-@item -i @var{string}
-Indent old-style parameter declarations with the string @var{string}.
-This option applies only to @code{protoize}.
-
-@code{unprotoize} converts prototyped function definitions to old-style
-function definitions, where the arguments are declared between the
-argument list and the initial @samp{@{}. By default, @code{unprotoize}
-uses five spaces as the indentation. If you want to indent with just
-one space instead, use @option{-i " "}.
-
-@item -k
-Keep the @samp{.X} files. Normally, they are deleted after conversion
-is finished.
-
-@item -l
-Add explicit local declarations. @code{protoize} with @option{-l} inserts
-a prototype declaration for each function in each block which calls the
-function without any declaration. This option applies only to
-@code{protoize}.
-
-@item -n
-Make no real changes. This mode just prints information about the conversions
-that would have been done without @option{-n}.
-
-@item -N
-Make no @samp{.save} files. The original files are simply deleted.
-Use this option with caution.
-
-@item -p @var{program}
-Use the program @var{program} as the compiler. Normally, the name
-@file{gcc} is used.
-
-@item -q
-Work quietly. Most warnings are suppressed.
-
-@item -v
-Print the version number, just like @option{-v} for @command{gcc}.
-@end table
-
-If you need special compiler options to compile one of your program's
-source files, then you should generate that file's @samp{.X} file
-specially, by running @command{gcc} on that source file with the
-appropriate options and the option @option{-aux-info}. Then run
-@code{protoize} on the entire set of files. @code{protoize} will use
-the existing @samp{.X} file because it is newer than the source file.
-For example:
-
-@smallexample
-gcc -Dfoo=bar file1.c -aux-info file1.X
-protoize *.c
-@end smallexample
-
-@noindent
-You need to include the special files along with the rest in the
-@code{protoize} command, even though their @samp{.X} files already
-exist, because otherwise they won't get converted.
-
-@xref{Protoize Caveats}, for more information on how to use
-@code{protoize} successfully.