re PR other/8947 (Please add a Warning about "-malign-double" in docs)
[platform/upstream/gcc.git] / gcc / doc / invoke.texi
index 8b60235..ab1e2da 100644 (file)
@@ -1,12 +1,12 @@
 @c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-@c 2000, 2001, 2002 Free Software Foundation, Inc.
+@c 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 
 @ignore
 @c man begin COPYRIGHT
 Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
-1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.1 or
@@ -367,22 +367,6 @@ in the following sections.
 -msoft-float  -msoft-quad-float  -msparclite  -mstack-bias @gol
 -msupersparc  -munaligned-doubles  -mv8}
 
-@emph{Convex Options}
-@gccoptlist{
--mc1  -mc2  -mc32  -mc34  -mc38 @gol
--margcount  -mnoargcount @gol
--mlong32  -mlong64 @gol
--mvolatile-cache  -mvolatile-nocache}
-
-@emph{AMD29K Options}
-@gccoptlist{
--m29000  -m29050  -mbw  -mnbw  -mdw  -mndw @gol
--mlarge  -mnormal  -msmall @gol
--mkernel-registers  -mno-reuse-arg-regs @gol
--mno-stack-check  -mno-storem-bug @gol
--mreuse-arg-regs  -msoft-float  -mstack-check @gol
--mstorem-bug  -muser-registers}
-
 @emph{ARM Options}
 @gccoptlist{
 -mapcs-frame  -mno-apcs-frame @gol
@@ -397,7 +381,6 @@ in the following sections.
 -mthumb-interwork  -mno-thumb-interwork @gol
 -mcpu=@var{name}  -march=@var{name}  -mfpe=@var{name}  @gol
 -mstructure-size-boundary=@var{n} @gol
--mbsd -mxopen  -mno-symrename @gol
 -mabort-on-noreturn @gol
 -mlong-calls  -mno-long-calls @gol
 -msingle-pic-base  -mno-single-pic-base @gol
@@ -566,10 +549,6 @@ in the following sections.
 @gccoptlist{
 -mvms-return-codes}
 
-@emph{Clipper Options}
-@gccoptlist{
--mc300  -mc400}
-
 @emph{H8/300 Options}
 @gccoptlist{
 -mrelax  -mh  -ms  -mn  -mint32  -malign-300}
@@ -3390,7 +3369,22 @@ is used when GCC itself is being built.)  @xref{Spec Files}.
 @cindex optimize options
 @cindex options, optimization
 
-These options control various sorts of optimizations:
+These options control various sorts of optimizations.
+
+Without any optimization option, the compiler's goal is to reduce the
+cost of compilation and to make debugging produce the expected
+results.  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.
+
+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.
+
+Not all optimizations are controlled directly by a flag.  Only
+optimizations that have a flag are listed.
 
 @table @gcctabopt
 @item -O
@@ -3400,17 +3394,25 @@ These options control various sorts of optimizations:
 Optimize.  Optimizing compilation takes somewhat more time, and a lot
 more memory for a large function.
 
-Without @option{-O}, the compiler's goal is to reduce the cost of
-compilation and to make debugging produce the expected results.
-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.
-
 With @option{-O}, the compiler tries to reduce code size and execution
 time, without performing any optimizations that take a great deal of
 compilation time.
 
+@option{-O} turns on the following optimization flags: 
+@gccoptlist{-fdefer-pop 
+-fmerge-constants
+-fthread-jumps
+-floop-optimize
+-fcrossjumping
+-fif-conversion
+-fif-conversion2
+-fdelayed-branch
+-fguess-branch-probability
+-fcprop-registers}
+
+@option{-O} also turns on @option{-fomit-frame-pointer} on machines
+where doing so does not interfere with debugging.
+
 @item -O2
 @opindex O2
 Optimize even more.  GCC performs nearly all supported optimizations
@@ -3419,11 +3421,25 @@ perform loop unrolling or function inlining when you specify @option{-O2}.
 As compared to @option{-O}, this option increases both compilation time
 and the performance of the generated code.
 
-@option{-O2} turns on all optional optimizations except for loop
-unrolling, function inlining, and register renaming.  It also turns on
-the @option{-fforce-mem} and @option{-fstrict-aliasing} option on all
-machines and frame pointer elimination on machines where doing so does
-not interfere with debugging.
+@option{-O2} turns on all optimization flags specified by @option{-O}.  It
+also turns on the following optimization flags:
+@gccoptlist{-fforce-mem
+-foptimize-sibling-calls
+-fstrength-reduce
+-fcse-follow-jumps  -fcse-skip-blocks
+-frerun-cse-after-loop  -frerun-loop-opt
+-fgcse   -fgcse-lm   -fgcse-sm
+-fdelete-null-pointer-checks
+-fexpensive-optimizations
+-fregmove
+-fschedule-insns  -fschedule-insns2
+-fsched-interblock -fsched-spec
+-fcaller-saves
+-fpeephole2
+-freorder-blocks  -freorder-functions
+-fstrict-aliasing
+-falign-functions  -falign-jumps
+-falign-loops  -falign-labels}
 
 Please note the warning under @option{-fgcse} about
 invoking @option{-O2} on programs that use computed gotos.
@@ -3436,7 +3452,7 @@ Optimize yet more.  @option{-O3} turns on all optimizations specified by
 
 @item -O0
 @opindex O0
-Do not optimize.
+Do not optimize.  This is the default.
 
 @item -Os
 @opindex Os
@@ -3444,16 +3460,25 @@ Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
 do not typically increase code size.  It also performs further
 optimizations designed to reduce code size.
 
+@option{-Os} disables the following optimization flags:
+@gccoptlist{-falign-functions  -falign-jumps  -falign-loops
+-falign-labels  -freorder-blocks -fprefetch-loop-arrays}
+
 If you use multiple @option{-O} options, with or without level numbers,
 the last such option is the one that is effective.
 @end table
 
 Options of the form @option{-f@var{flag}} specify machine-independent
 flags.  Most flags have both positive and negative forms; the negative
-form of @option{-ffoo} would be @option{-fno-foo}.  In the table below,
-only one of the forms is listed---the one which is not the default.
-You can figure out the other form by either removing @samp{no-} or
-adding it.
+form of @option{-ffoo} would be @option{-fno-foo}.  In the table
+below, only one of the forms is listed---the one you typically will
+use.  You can figure out the other form by either removing @samp{no-}
+or adding it.
+
+The following options control specific optimizations.  They are either
+activated by @option{-O} options or are related to ones that are.  You
+can use the following flags in the rare cases when ``fine-tuning'' of
+optimizations to be performed is desired.
 
 @table @gcctabopt
 @item -ffloat-store
@@ -3719,21 +3744,6 @@ indices used to access arrays are within the declared range.  This is
 currently only supported by the Java and Fortran 77 front-ends, where
 this option defaults to true and false respectively.
 
-@end table
-
-The following options control specific optimizations.  The @option{-O2}
-option turns on all of these optimizations except @option{-funroll-loops}
-and @option{-funroll-all-loops}.  On most machines, the @option{-O} option
-turns on the @option{-fthread-jumps} and @option{-fdelayed-branch} options,
-but specific machines may handle it differently.
-
-You can use the following flags in the rare cases when ``fine-tuning''
-of optimizations to be performed is desired.
-
-Not all of the optimizations performed by GCC have @option{-f} options
-to control them.
-
-@table @gcctabopt
 @item -fstrength-reduce
 @opindex fstrength-reduce
 Perform the optimizations of loop strength reduction and
@@ -5252,8 +5262,6 @@ that macro, which enables you to change the defaults.
 * M68hc1x Options::
 * VAX Options::
 * SPARC Options::
-* Convex Options::
-* AMD29K Options::
 * ARM Options::
 * MN10200 Options::
 * MN10300 Options::
@@ -5268,7 +5276,6 @@ that macro, which enables you to change the defaults.
 * Intel 960 Options::
 * DEC Alpha Options::
 * DEC Alpha/VMS Options::
-* Clipper Options::
 * H8/300 Options::
 * SH Options::
 * System V Options::
@@ -5799,195 +5806,6 @@ when making stack frame references.
 Otherwise, assume no such offset is present.
 @end table
 
-@node Convex Options
-@subsection Convex Options
-@cindex Convex options
-
-These @samp{-m} options are defined for Convex:
-
-@table @gcctabopt
-@item -mc1
-@opindex mc1
-Generate output for C1.  The code will run on any Convex machine.
-The preprocessor symbol @code{__convex__c1__} is defined.
-
-@item -mc2
-@opindex mc2
-Generate output for C2.  Uses instructions not available on C1.
-Scheduling and other optimizations are chosen for max performance on C2.
-The preprocessor symbol @code{__convex_c2__} is defined.
-
-@item -mc32
-@opindex mc32
-Generate output for C32xx.  Uses instructions not available on C1.
-Scheduling and other optimizations are chosen for max performance on C32.
-The preprocessor symbol @code{__convex_c32__} is defined.
-
-@item -mc34
-@opindex mc34
-Generate output for C34xx.  Uses instructions not available on C1.
-Scheduling and other optimizations are chosen for max performance on C34.
-The preprocessor symbol @code{__convex_c34__} is defined.
-
-@item -mc38
-@opindex mc38
-Generate output for C38xx.  Uses instructions not available on C1.
-Scheduling and other optimizations are chosen for max performance on C38.
-The preprocessor symbol @code{__convex_c38__} is defined.
-
-@item -margcount
-@opindex margcount
-Generate code which puts an argument count in the word preceding each
-argument list.  This is compatible with regular CC, and a few programs
-may need the argument count word.  GDB and other source-level debuggers
-do not need it; this info is in the symbol table.
-
-@item -mnoargcount
-@opindex mnoargcount
-Omit the argument count word.  This is the default.
-
-@item -mvolatile-cache
-@opindex mvolatile-cache
-Allow volatile references to be cached.  This is the default.
-
-@item -mvolatile-nocache
-@opindex mvolatile-nocache
-Volatile references bypass the data cache, going all the way to memory.
-This is only needed for multi-processor code that does not use standard
-synchronization instructions.  Making non-volatile references to volatile
-locations will not necessarily work.
-
-@item -mlong32
-@opindex mlong32
-Type long is 32 bits, the same as type int.  This is the default.
-
-@item -mlong64
-@opindex mlong64
-Type long is 64 bits, the same as type long long.  This option is useless,
-because no library support exists for it.
-@end table
-
-@node AMD29K Options
-@subsection AMD29K Options
-@cindex AMD29K options
-
-These @samp{-m} options are defined for the AMD Am29000:
-
-@table @gcctabopt
-@item -mdw
-@opindex mdw
-@cindex DW bit (29k)
-Generate code that assumes the @code{DW} bit is set, i.e., that byte and
-halfword operations are directly supported by the hardware.  This is the
-default.
-
-@item -mndw
-@opindex mndw
-Generate code that assumes the @code{DW} bit is not set.
-
-@item -mbw
-@opindex mbw
-@cindex byte writes (29k)
-Generate code that assumes the system supports byte and halfword write
-operations.  This is the default.
-
-@item -mnbw
-@opindex mnbw
-Generate code that assumes the systems does not support byte and
-halfword write operations.  @option{-mnbw} implies @option{-mndw}.
-
-@item -msmall
-@opindex msmall
-@cindex memory model (29k)
-Use a small memory model that assumes that all function addresses are
-either within a single 256 KB segment or at an absolute address of less
-than 256k.  This allows the @code{call} instruction to be used instead
-of a @code{const}, @code{consth}, @code{calli} sequence.
-
-@item -mnormal
-@opindex mnormal
-Use the normal memory model: Generate @code{call} instructions only when
-calling functions in the same file and @code{calli} instructions
-otherwise.  This works if each file occupies less than 256 KB but allows
-the entire executable to be larger than 256 KB@.  This is the default.
-
-@item -mlarge
-@opindex mlarge
-Always use @code{calli} instructions.  Specify this option if you expect
-a single file to compile into more than 256 KB of code.
-
-@item -m29050
-@opindex m29050
-@cindex processor selection (29k)
-Generate code for the Am29050.
-
-@item -m29000
-@opindex m29000
-Generate code for the Am29000.  This is the default.
-
-@item -mkernel-registers
-@opindex mkernel-registers
-@cindex kernel and user registers (29k)
-Generate references to registers @code{gr64-gr95} instead of to
-registers @code{gr96-gr127}.  This option can be used when compiling
-kernel code that wants a set of global registers disjoint from that used
-by user-mode code.
-
-Note that when this option is used, register names in @samp{-f} flags
-must use the normal, user-mode, names.
-
-@item -muser-registers
-@opindex muser-registers
-Use the normal set of global registers, @code{gr96-gr127}.  This is the
-default.
-
-@item -mstack-check
-@itemx -mno-stack-check
-@opindex mstack-check
-@opindex mno-stack-check
-@cindex stack checks (29k)
-Insert (or do not insert) a call to @code{__msp_check} after each stack
-adjustment.  This is often used for kernel code.
-
-@item -mstorem-bug
-@itemx -mno-storem-bug
-@opindex mstorem-bug
-@opindex mno-storem-bug
-@cindex storem bug (29k)
-@option{-mstorem-bug} handles 29k processors which cannot handle the
-separation of a mtsrim insn and a storem instruction (most 29000 chips
-to date, but not the 29050).
-
-@item -mno-reuse-arg-regs
-@itemx -mreuse-arg-regs
-@opindex mno-reuse-arg-regs
-@opindex mreuse-arg-regs
-@option{-mno-reuse-arg-regs} tells the compiler to only use incoming argument
-registers for copying out arguments.  This helps detect calling a function
-with fewer arguments than it was declared with.
-
-@item -mno-impure-text
-@itemx -mimpure-text
-@opindex mno-impure-text
-@opindex mimpure-text
-@option{-mimpure-text}, used in addition to @option{-shared}, tells the compiler to
-not pass @option{-assert pure-text} to the linker when linking a shared object.
-
-@item -msoft-float
-@opindex msoft-float
-Generate output containing library calls for floating point.
-@strong{Warning:} the requisite libraries are not part of GCC@.
-Normally the facilities of the machine's usual C compiler are used, but
-this can't be done directly in cross-compilation.  You must make your
-own arrangements to provide suitable library functions for
-cross-compilation.
-
-@item -mno-multm
-@opindex mno-multm
-Do not generate multm or multmu instructions.  This is useful for some embedded
-systems which do not have trap handlers for these instructions.
-@end table
-
 @node ARM Options
 @subsection ARM Options
 @cindex ARM options
@@ -6152,25 +5970,6 @@ These are deprecated aliases for @option{-malignment-traps}.
 @opindex mshort-load-words
 This are deprecated aliases for @option{-mno-alignment-traps}.
 
-@item -mbsd
-@opindex mbsd
-This option only applies to RISC iX@.  Emulate the native BSD-mode
-compiler.  This is the default if @option{-ansi} is not specified.
-
-@item -mxopen
-@opindex mxopen
-This option only applies to RISC iX@.  Emulate the native X/Open-mode
-compiler.
-
-@item -mno-symrename
-@opindex mno-symrename
-This option only applies to RISC iX@.  Do not run the assembler
-post-processor, @samp{symrename}, after code has been assembled.
-Normally it is necessary to modify some of the standard symbols in
-preparation for linking with the RISC iX C library; this option
-suppresses this pass.  The post-processor is never run when the
-compiler is built for cross-compilation.
-
 @item -mcpu=@var{name}
 @opindex mcpu
 This specifies the name of the target ARM processor.  GCC uses this name
@@ -6512,9 +6311,9 @@ underscore as prefix on each name.
 Include (or omit) additional debugging information (about registers used
 in each stack frame) as specified in the 88open Object Compatibility
 Standard, ``OCS''@.  This extra information allows debugging of code that
-has had the frame pointer eliminated.  The default for DG/UX, SVr4, and
-Delta 88 SVr3.2 is to include this information; other 88k configurations
-omit this information by default.
+has had the frame pointer eliminated.  The default for SVr4 and Delta 88
+SVr3.2 is to include this information; other 88k configurations omit this
+information by default.
 
 @item -mocs-frame-position
 @opindex mocs-frame-position
@@ -6522,7 +6321,7 @@ omit this information by default.
 When emitting COFF debugging information for automatic variables and
 parameters stored on the stack, use the offset from the canonical frame
 address, which is the stack pointer (register 31) on entry to the
-function.  The DG/UX, SVr4, Delta88 SVr3.2, and BCS configurations use
+function.  The SVr4 and Delta88 SVr3.2, and BCS configurations use
 @option{-mocs-frame-position}; other 88k configurations have the default
 @option{-mno-ocs-frame-position}.
 
@@ -6609,9 +6408,8 @@ that is used on System V release 4.
 SVr4.
 @end enumerate
 
-@option{-msvr4} is the default for the m88k-motorola-sysv4 and
-m88k-dg-dgux m88k configurations.  @option{-msvr3} is the default for all
-other m88k configurations.
+@option{-msvr4} is the default for the m88k-motorola-sysv4 configuration.
+@option{-msvr3} is the default for all other m88k configurations.
 
 @item -mversion-03.00
 @opindex mversion-03.00
@@ -8020,9 +7818,11 @@ boundary.  Aligning @code{double} variables on a two word boundary will
 produce code that runs somewhat faster on a @samp{Pentium} at the
 expense of more memory.
 
-@strong{Warning:} if you use the @samp{-malign-double} switch,
+@strong{Warning:} if you use the @option{-malign-double} switch,
 structures containing the above types will be aligned differently than
-the published application binary interface specifications for the 386.
+the published application binary interface specifications for the 386
+and will not be binary compatible with structures in code compiled
+without that switch.
 
 @item -m128bit-long-double
 @opindex m128bit-long-double
@@ -8844,22 +8644,6 @@ Return VMS condition codes from main.  The default is to return POSIX
 style condition (e.g.@ error) codes.
 @end table
 
-@node Clipper Options
-@subsection Clipper Options
-
-These @samp{-m} options are defined for the Clipper implementations:
-
-@table @gcctabopt
-@item -mc300
-@opindex mc300
-Produce code for a C300 Clipper processor.  This is the default.
-
-@item -mc400
-@opindex mc400
-Produce code for a C400 Clipper processor, i.e.@: use floating point
-registers f8--f15.
-@end table
-
 @node H8/300 Options
 @subsection H8/300 Options