From b36fd572e6cbe63dca6fbedd91f17d2797524eaa Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Tue, 17 Nov 2020 10:35:40 +0000 Subject: [PATCH 40/40] opts: move -fpartial-inlining from -O2 to -O3 or higher. We have observed strange behavior from the inliner on mips and on s390x when the new partial inlining feature is enabled. --- gcc/doc/invoke.texi | 5 +++-- gcc/opts.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 01e67e97491..6c4c2937b8f 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -9212,7 +9212,6 @@ also turns on the following optimization flags: -flra-remat @gol -foptimize-sibling-calls @gol -foptimize-strlen @gol --fpartial-inlining @gol -fpeephole2 @gol -freorder-blocks-algorithm=stc @gol -freorder-blocks-and-partition -freorder-functions @gol @@ -9234,7 +9233,8 @@ NOTE: In Alpine Linux, @option{-D_FORTIFY_SOURCE=2} is set by default, and is activated when @option{-O} is set to 2 or higher. This enables additional compile-time and run-time checks for several libc functions. To disable, specify either @option{-U_FORTIFY_SOURCE} or -@option{-D_FORTIFY_SOURCE=0}. +@option{-D_FORTIFY_SOURCE=0}. Additionally, @option{-fpartial-inlining} +is only activated when @option{-O} is set to 3 or higher. @item -O3 @opindex O3 @@ -9246,6 +9246,7 @@ by @option{-O2} and also turns on the following optimization flags: -fipa-cp-clone -floop-interchange @gol -floop-unroll-and-jam @gol +-fpartial-inlining @gol -fpeel-loops @gol -fpredictive-commoning @gol -fsplit-loops @gol diff --git a/gcc/opts.c b/gcc/opts.c index 73162528938..1d0d997eda2 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -492,7 +492,6 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_2_PLUS, OPT_fisolate_erroneous_paths_dereference, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_flra_remat, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_foptimize_sibling_calls, NULL, 1 }, - { OPT_LEVELS_2_PLUS, OPT_fpartial_inlining, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_fpeephole2, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_frerun_cse_after_loop, NULL, 1 }, @@ -530,6 +529,7 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_3_PLUS, OPT_fipa_cp_clone, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_floop_interchange, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_floop_unroll_and_jam, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_fpartial_inlining, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_fpeel_loops, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 }, { OPT_LEVELS_3_PLUS, OPT_fsplit_loops, NULL, 1 }, -- 2.29.2