diff options
author | Teresa Johnson <tejohnson@google.com> | 2015-09-25 16:53:40 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@gcc.gnu.org> | 2015-09-25 16:53:40 +0000 |
commit | 6697104844b95eb653a26e725f70600bdade0150 (patch) | |
tree | 0929635a605ef836dda743b622ad63f002335dba /gcc | |
parent | 5e2f2cd5842d2543721a895c64a3b2a553542344 (diff) | |
download | gcc-6697104844b95eb653a26e725f70600bdade0150.zip gcc-6697104844b95eb653a26e725f70600bdade0150.tar.gz gcc-6697104844b95eb653a26e725f70600bdade0150.tar.bz2 |
This patch unsets -freorder-blocks-and-partition when -fprofile-use is not specified.
This patch unsets -freorder-blocks-and-partition when -fprofile-use
is not specified. Function splitting was not actually being performed
in that case, as probably_never_executed_bb_p does not distinguish
any basic blocks as being cold vs hot when there is no profile data.
Leaving it enabled, however, causes the assembly code generator to create
(empty) cold sections and labels, leading to unnecessary size overhead.
2015-09-25 Teresa Johnson <tejohnson@google.com>
* opts.c (finish_options): Unset -freorder-blocks-and-partition
if not using profile.
From-SVN: r228136
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/opts.c | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7c39c51..1142446 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-09-25 Teresa Johnson <tejohnson@google.com> + + * opts.c (finish_options): Unset -freorder-blocks-and-partition + if not using profile. + 2015-09-25 Manuel López-Ibáñez <manu@gcc.gnu.org> PR pretty-print/67567 @@ -821,6 +821,16 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set, opts->x_flag_reorder_blocks = 1; } + /* Disable -freorder-blocks-and-partition when -fprofile-use is not in + effect. Function splitting was not actually being performed in that case, + as probably_never_executed_bb_p does not distinguish any basic blocks as + being cold vs hot when there is no profile data. Leaving it enabled, + however, causes the assembly code generator to create (empty) cold + sections and labels, leading to unnecessary size overhead. */ + if (opts->x_flag_reorder_blocks_and_partition + && !opts_set->x_flag_profile_use) + opts->x_flag_reorder_blocks_and_partition = 0; + if (opts->x_flag_reorder_blocks_and_partition && !opts_set->x_flag_reorder_functions) opts->x_flag_reorder_functions = 1; |