From 61ff1ae33c32e7943007584b0bfd969b42bff2e8 Mon Sep 17 00:00:00 2001 From: segher Date: Sat, 7 Nov 2015 19:44:21 +0000 Subject: [PATCH] i386: Use the STC bb-reorder algorithm at -Os (PR67864) For x86, STC still gives better results for optimise-for-size than "simple" does. So use STC at -Os as well. PR rtl-optimization/67864 * common/config/i386/i386-common.c (ix86_option_optimization_table) : Use REORDER_BLOCKS_ALGORITHM_STC at -Os and up. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229937 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/common/config/i386/i386-common.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5d9d2f897d1d..109936d48252 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-11-07 Segher Boessenkool + + PR rtl-optimization/67864 + * common/config/i386/i386-common.c (ix86_option_optimization_table) + : Use REORDER_BLOCKS_ALGORITHM_STC + at -Os and up. + 2015-11-07 Richard Sandiford * trans-mem.c (is_tm_pure_call): Use gimple_call_flags for diff --git a/gcc/common/config/i386/i386-common.c b/gcc/common/config/i386/i386-common.c index 0f8c3e1df04c..49899bd6fa6d 100644 --- a/gcc/common/config/i386/i386-common.c +++ b/gcc/common/config/i386/i386-common.c @@ -997,6 +997,9 @@ static const struct default_options ix86_option_optimization_table[] = { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 }, /* Enable function splitting at -O2 and higher. */ { OPT_LEVELS_2_PLUS, OPT_freorder_blocks_and_partition, NULL, 1 }, + /* The STC algorithm produces the smallest code at -Os, for x86. */ + { OPT_LEVELS_2_PLUS, OPT_freorder_blocks_algorithm_, NULL, + REORDER_BLOCKS_ALGORITHM_STC }, /* Turn off -fschedule-insns by default. It tends to make the problem with not enough registers even worse. */ { OPT_LEVELS_ALL, OPT_fschedule_insns, NULL, 0 }, -- 2.47.2