This reduces -Og compile-time for the testcase in PR46590 from 116s to 40s (still way short of -O0 compile-time which is 17s). It does so by disabling the rest of loop2 (RTL invariant motion and doloop) as I originally intended and by disabling PTA which can get quite expensive on larger testcases (especially for fortran which makes heavy use of fnspecs).
Bootstrap with BOOT_CFLAGS="-Og -g" on x86_64-unknown-linux-gnu in progress. Richard. 2014-01-17 Richard Biener <rguent...@suse.de> PR tree-optimization/46590 * opts.c (default_options_table): Add entries for OPT_fbranch_count_reg, OPT_fmove_loop_invariants and OPT_ftree_pta, all enabled at -O1 but not for -Og. * common.opt (fbranch-count-reg): Remove Init(1). (fmove-loop-invariants): Likewise. (ftree-pta): Likewise. Index: gcc/opts.c =================================================================== *** gcc/opts.c (revision 206702) --- gcc/opts.c (working copy) *************** static const struct default_options defa *** 454,459 **** --- 454,462 ---- { OPT_LEVELS_1_PLUS, OPT_fcombine_stack_adjustments, NULL, 1 }, { OPT_LEVELS_1_PLUS, OPT_fcompare_elim, NULL, 1 }, { OPT_LEVELS_1_PLUS, OPT_ftree_slsr, NULL, 1 }, + { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fbranch_count_reg, NULL, 1 }, + { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fmove_loop_invariants, NULL, 1 }, + { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_ftree_pta, NULL, 1 }, /* -O2 optimizations. */ { OPT_LEVELS_2_PLUS, OPT_finline_small_functions, NULL, 1 }, Index: gcc/common.opt =================================================================== *** gcc/common.opt (revision 206702) --- gcc/common.opt (working copy) *************** Common Report Var(flag_bounds_check) *** 875,881 **** Generate code to check bounds before indexing arrays fbranch-count-reg ! Common Report Var(flag_branch_on_count_reg) Init(1) Optimization Replace add, compare, branch with branch on count register fbranch-probabilities --- 875,881 ---- Generate code to check bounds before indexing arrays fbranch-count-reg ! Common Report Var(flag_branch_on_count_reg) Optimization Replace add, compare, branch with branch on count register fbranch-probabilities *************** Common Report Var(flag_modulo_sched_allo *** 1564,1570 **** Perform SMS based modulo scheduling with register moves allowed fmove-loop-invariants ! Common Report Var(flag_move_loop_invariants) Init(1) Optimization Move loop invariant computations out of loops fdce --- 1564,1570 ---- Perform SMS based modulo scheduling with register moves allowed fmove-loop-invariants ! Common Report Var(flag_move_loop_invariants) Optimization Move loop invariant computations out of loops fdce *************** Common Report Var(flag_tree_partial_pre) *** 2170,2176 **** In SSA-PRE optimization on trees, enable partial-partial redundancy elimination ftree-pta ! Common Report Var(flag_tree_pta) Init(1) Optimization Perform function-local points-to analysis on trees. ftree-reassoc --- 2170,2176 ---- In SSA-PRE optimization on trees, enable partial-partial redundancy elimination ftree-pta ! Common Report Var(flag_tree_pta) Optimization Perform function-local points-to analysis on trees. ftree-reassoc