diff options
author | Martin Liska <marxin.liska@gmail.com> | 2013-12-17 22:20:12 +0000 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2013-12-17 22:20:12 +0000 |
commit | 9cec31f43afbdb326fddbc144e9aea63986828e4 (patch) | |
tree | 3ad29a01dabd9e49f49f9ebdc04f7655721d6300 /gcc/varasm.c | |
parent | 14407011d62da724e88ac0cb30390d3f8fda2b9f (diff) | |
download | gcc-9cec31f43afbdb326fddbc144e9aea63986828e4.zip gcc-9cec31f43afbdb326fddbc144e9aea63986828e4.tar.gz gcc-9cec31f43afbdb326fddbc144e9aea63986828e4.tar.bz2 |
Time profile-based function reordering (phase 2).
Co-Authored-By: Jan Hubicka <jh@suse.cz>
From-SVN: r206070
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 5c5025a..1d2c03e 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -552,7 +552,14 @@ default_function_section (tree decl, enum node_frequency freq, unlikely executed (this happens especially with function splitting where we can split away unnecessary parts of static constructors. */ if (startup && freq != NODE_FREQUENCY_UNLIKELY_EXECUTED) - return get_named_text_section (decl, ".text.startup", NULL); + { + /* If we do have a profile or(and) LTO phase is executed, we do not need + these ELF section. */ + if (!in_lto_p || !flag_profile_values) + return get_named_text_section (decl, ".text.startup", NULL); + else + return NULL; + } /* Similarly for exit. */ if (exit && freq != NODE_FREQUENCY_UNLIKELY_EXECUTED) @@ -564,7 +571,10 @@ default_function_section (tree decl, enum node_frequency freq, case NODE_FREQUENCY_UNLIKELY_EXECUTED: return get_named_text_section (decl, ".text.unlikely", NULL); case NODE_FREQUENCY_HOT: - return get_named_text_section (decl, ".text.hot", NULL); + /* If we do have a profile or(and) LTO phase is executed, we do not need + these ELF section. */ + if (!in_lto_p || !flag_profile_values) + return get_named_text_section (decl, ".text.hot", NULL); default: return NULL; } |