This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] optimization docs part 6
- From: Jerome L Quinn <jlquinn at us dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Aug 2002 12:00:26 -0400
- Subject: [PATCH] optimization docs part 6
- Sensitivity:
In this last patch, I reworked the -0 descriptions some. The -O2 flag
needed it as it
was incorrect. The remainder I thought was more readable.
2002-08-30 Jerry Quinn <jlquinn@us.ibm.com>
* gcc/gcc/doc/invoke.texi (Optimization Options): Clean up -O flag
descriptions.
--- gcc/gcc/doc/invoke.texi.safe 2002-08-25 01:40:52.000000000
-0400
+++ gcc/gcc/doc/invoke.texi 2002-08-25 01:41:43.000000000 -0400
@@ -3175,7 +3175,23 @@
@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
@@ -3185,13 +3201,6 @@
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.
@@ -3269,20 +3278,20 @@
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 -fno-default-inline
-@opindex fno-default-inline
-Do not make member functions inline by default merely because they are
-defined inside the class scope (C++ only). Otherwise, when you specify
-@w{@option{-O}}, member functions defined inside class scope are compiled
-inline by default; i.e., you don't need to add @samp{inline} in front of
-the member function name.
+Not all of the optimizations performed by GCC have @option{-f} options
+to control them.
+@table @gcctabopt
@item -fno-defer-pop
@opindex fno-defer-pop
Always pop the arguments to each function call as soon as that function
@@ -3335,6 +3344,14 @@
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+@item -fno-default-inline
+@opindex fno-default-inline
+Do not make member functions inline by default merely because they are
+defined inside the class scope (C++ only). Otherwise, when you specify
+@w{@option{-O}}, member functions defined inside class scope are compiled
+inline by default; i.e., you don't need to add @samp{inline} in front of
+the member function name.
+
@item -fno-inline
@opindex fno-inline
Don't pay attention to the @code{inline} keyword. Normally this option
@@ -3431,21 +3448,7 @@
assumptions based on that.
The default is @option{-fzero-initialized-in-bss}.
-@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