The documentation is confused in various ways depending on the active branch,
although the implementation in opts.c is strictly identical on all of them:
mainline:
Enabled at levels `-O2', `-O3', `-Os'. Also enabled by
`-fprofile-use' and `-fauto-profile'.
8 branch:
Enabled at levels `-O2', `-O3', `-Os'.
7 branch:
Enabled at level `-O3'.
None is fully correct, the correct form being:
Enabled at levels `-O3', `-Os'. Also enabled by `-fprofile-use'
and `-fauto-profile'.
Tested with 'make doc', applied on all active branches as obvious.
2019-01-09 Eric Botcazou <ebotca...@adacore.com>
* doc/invoke.texi (-Os): Remove trailing spaces.
(-finline-functions): Remove reference to -O2.
2019-01-09 Eric Botcazou <ebotca...@adacore.com>
* doc/invoke.texi (-Os): Add reference to -finline-functions.
(-finline-functions): Remove reference to -O2, add references
to -fprofile-use and -fauto-profile.
2019-01-09 Eric Botcazou <ebotca...@adacore.com>
* doc/invoke.texi (-Os): Add reference to -finline-functions.
(-finline-small-functions): Add references to -O3 and -Os.
(-findirect-inlining): Likewise.
(-finline-functions): Add references to -Os, -fprofile-use and
-fauto-profile.
--
Eric Botcazou
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (revision 267608)
+++ doc/invoke.texi (working copy)
@@ -7136,14 +7136,17 @@ results. This is the default.
@item -Os
@opindex Os
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.
+do not typically increase code size.
@option{-Os} disables the following optimization flags:
@gccoptlist{-falign-functions -falign-jumps -falign-loops @gol
-falign-labels -freorder-blocks -freorder-blocks-algorithm=stc @gol
-freorder-blocks-and-partition -fprefetch-loop-arrays}
+It also enables @option{-finline-functions}, causes the compiler to tune for
+code size rather than execution speed, and performs further optimizations
+designed to reduce code size.
+
@item -Ofast
@opindex Ofast
Disregard strict standards compliance. @option{-Ofast} enables all
@@ -7261,7 +7264,7 @@ heuristically decides which functions ar
in this way. This inlining applies to all functions, even those not declared
inline.
-Enabled at level @option{-O2}.
+Enabled at level @option{-O2}, @option{-O3}, @option{-Os}.
@item -findirect-inlining
@opindex findirect-inlining
@@ -7270,7 +7273,7 @@ time thanks to previous inlining. This
when inlining itself is turned on by the @option{-finline-functions}
or @option{-finline-small-functions} options.
-Enabled at level @option{-O2}.
+Enabled at level @option{-O2}, @option{-O3}, @option{-Os}.
@item -finline-functions
@opindex finline-functions
@@ -7282,7 +7285,8 @@ If all calls to a given function are int
declared @code{static}, then the function is normally not output as
assembler code in its own right.
-Enabled at level @option{-O3}.
+Enabled at levels @option{-O3}, @option{-Os}. Also enabled
+by @option{-fprofile-use} and @option{-fauto-profile}.
@item -finline-functions-called-once
@opindex finline-functions-called-once
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (revision 267607)
+++ doc/invoke.texi (working copy)
@@ -7675,14 +7675,17 @@ results. This is the default.
@item -Os
@opindex Os
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.
+do not typically increase code size.
@option{-Os} disables the following optimization flags:
@gccoptlist{-falign-functions -falign-jumps -falign-loops @gol
-falign-labels -freorder-blocks -freorder-blocks-algorithm=stc @gol
-freorder-blocks-and-partition -fprefetch-loop-arrays}
+It also enables @option{-finline-functions}, causes the compiler to tune for
+code size rather than execution speed, and performs further optimizations
+designed to reduce code size.
+
@item -Ofast
@opindex Ofast
Disregard strict standards compliance. @option{-Ofast} enables all
@@ -7803,7 +7806,8 @@ time thanks to previous inlining. This
when inlining itself is turned on by the @option{-finline-functions}
or @option{-finline-small-functions} options.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O3}, @option{-Os}. Also enabled
+by @option{-fprofile-use} and @option{-fauto-profile}.
@item -finline-functions
@opindex finline-functions
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (revision 267574)
+++ doc/invoke.texi (working copy)
@@ -8247,7 +8247,7 @@ except those that often increase code si
It also enables @option{-finline-functions}, causes the compiler to tune for
code size rather than execution speed, and performs further optimizations
-designed to reduce code size.
+designed to reduce code size.
@item -Ofast
@opindex Ofast
@@ -8395,7 +8395,7 @@ If all calls to a given function are int
declared @code{static}, then the function is normally not output as
assembler code in its own right.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. Also enabled
+Enabled at levels @option{-O3}, @option{-Os}. Also enabled
by @option{-fprofile-use} and @option{-fauto-profile}.
@item -finline-functions-called-once