This is the mail archive of the
mailing list for the GCC project.
Do not silently disable flag_reorder_functions when profile info is missing
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 8 Jun 2017 16:50:28 +0200
- Subject: Do not silently disable flag_reorder_functions when profile info is missing
- Authentication-results: sourceware.org; auth=none
flag_reorder_functions is now able to offload code leading to cold function calls.
For this reason it now makes sense to enable with w/o profiling as well (I plan to
enable it for -O2 but by a separate patch)
Bootstrapped/regtested x86_64-linux, comitted.
* opts.c (finish_options): x_flag_reorder_blocks_and_partition no
longer requires x_flag_profile_use.
--- opts.c (revision 249013)
+++ opts.c (working copy)
@@ -863,16 +863,6 @@ finish_options (struct gcc_options *opts
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;
opts->x_flag_reorder_functions = 1;