ptomsich@android:~/riscv/gcc/gcc$ git grep OPT_LEVELS_3
common/common-target.h: OPT_LEVELS_3_PLUS, /* -O3 and above. */
common/common-target.h: OPT_LEVELS_3_PLUS_AND_SIZE, /* -O3 and above and -Os.
*/
common/config/arc/arc-common.c:#define OPT_LEVELS_3_PLUS_SPEED_ONLY
OPT_LEVELS_3_PLUS
common/config/arc/arc-common.c: { OPT_LEVELS_3_PLUS_SPEED_ONLY,
OPT_msize_level_, NULL, 0 },
common/config/arc/arc-common.c: { OPT_LEVELS_3_PLUS_SPEED_ONLY,
OPT_malign_call, NULL, 1 },
common/config/nios2/nios2-common.c: { OPT_LEVELS_3_PLUS, OPT_mfast_sw_div,
NULL, 1 },
opts.c: case OPT_LEVELS_3_PLUS:
opts.c: case OPT_LEVELS_3_PLUS_AND_SIZE:
opts.c: { OPT_LEVELS_3_PLUS_AND_SIZE, OPT_finline_functions, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_fgcse_after_reload, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_fipa_cp_clone, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_floop_interchange, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_floop_unroll_and_jam, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_fpeel_loops, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_fsplit_loops, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_fsplit_paths, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribution, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_loop_vectorize, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_partial_pre, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_ftree_slp_vectorize, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_funswitch_loops, NULL, 1 },
opts.c: { OPT_LEVELS_3_PLUS, OPT_fvect_cost_model_, NULL,
VECT_COST_MODEL_DYNAMIC },
opts.c: { OPT_LEVELS_3_PLUS, OPT_fversion_loops_for_strides, NULL, 1 },
On 22.04.2020, at 16:01, Erick Ochoa <erick.oc...@theobroma-systems.com> wrote:
Hello,
Does anyone know if the following text from the GCC internals [0] is outdated?
-O3
Optimize yet more. -O3 turns on all optimizations specified by -O2 and also
turns on the following optimization flags:
-fgcse-after-reload
-fipa-cp-clone
-floop-interchange
-floop-unroll-and-jam
-fpeel-loops
-fpredictive-commoning
-fsplit-paths
-ftree-loop-distribute-patterns
-ftree-loop-distribution
-ftree-loop-vectorize
-ftree-partial-pre
-ftree-slp-vectorize
-funswitch-loops
-fvect-cost-model
-fversion-loops-for-strides
I ask because I have an optimization pass that interacts poorly with -O3, but
compiles and runs correctly with -O2.
I'm trying to find which individual (or combination of optimizations) is
triggering the runtime error I'm debugging.
I tried running -O2 and manually enable all the optimizations turned on by -O3
(but without specifying -O3) and my pass runs successfully.
So, either:
* -O3 does more than just enable these optimizations, or
* This documentation is outdated and there's something missing.
Does someone have an answer? (And if possible point to some code locations so
that I can learn where it is.) Thanks!
[0] https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html