diff options
author | Sam James <sam@gentoo.org> | 2024-07-23 15:06:10 +0100 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2024-07-25 14:20:55 +0200 |
commit | 634eae5ec3f3af2c4f6221d3ed2cf78d7f5c47f0 (patch) | |
tree | ffcf8b6a2521e9083a89948bedb234a7992bff2b | |
parent | 3f578dbac726d47b043b82606c47e5676c5d6a14 (diff) | |
download | gcc-634eae5ec3f3af2c4f6221d3ed2cf78d7f5c47f0.zip gcc-634eae5ec3f3af2c4f6221d3ed2cf78d7f5c47f0.tar.gz gcc-634eae5ec3f3af2c4f6221d3ed2cf78d7f5c47f0.tar.bz2 |
doc: Document -O1 as the preferred level for large machine-generated code
At -O1, the intention is that we compile things in a "reasonable" amount
of time (ditto memory use). In particular, we try to especially avoid
optimizations which scale poorly on pathological cases, as is the case
for large machine-generated code.
Recommend -O1 for large machine-generated code, as has been informally
done on bugs for a while now.
This applies (broadly speaking) for both large machine-generated functions
but also to a lesser extent repetitive small-but-still-not-tiny functions
from a generator program.
gcc/ChangeLog:
PR middle-end/114855
* doc/invoke.texi (Optimize options): Mention machine-generated
code for -O1.
-rw-r--r-- | gcc/doc/invoke.texi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index e0a6412..9fb0925 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -12560,6 +12560,11 @@ 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} is the recommended optimization level for large machine-generated +code as a sensible balance between time taken to compile and memory use: +higher optimization levels perform optimizations with greater algorithmic +complexity than at @option{-O}. + @c Note that in addition to the default_options_table list in opts.cc, @c several optimization flags default to true but control optimization @c passes that are explicitly disabled at -O0. |