Commit 12651dc6 by Jan Hubicka Committed by Jan Hubicka

varasm.c (default_function_section): Fix confused tests for tp_first_run reordering.

	* varasm.c (default_function_section): Fix confused tests for
	tp_first_run reordering.

From-SVN: r279176
parent 91fd16a7
2019-12-10 Jan Hubicka <hubicka@ucw.cz>
* varasm.c (default_function_section): Fix confused tests for
tp_first_run reordering.
2019-12-10 Richard Sandiford <richard.sandiford@arm.com> 2019-12-10 Richard Sandiford <richard.sandiford@arm.com>
* config/aarch64/aarch64.c (aarch64_hard_regno_mode_ok): Don't * config/aarch64/aarch64.c (aarch64_hard_regno_mode_ok): Don't
...@@ -589,9 +589,13 @@ default_function_section (tree decl, enum node_frequency freq, ...@@ -589,9 +589,13 @@ default_function_section (tree decl, enum node_frequency freq,
where we can split away unnecessary parts of static constructors. */ where we can split away unnecessary parts of static constructors. */
if (startup && freq != NODE_FREQUENCY_UNLIKELY_EXECUTED) if (startup && freq != NODE_FREQUENCY_UNLIKELY_EXECUTED)
{ {
/* If we do have a profile or(and) LTO phase is executed, we do not need /* During LTO the tp_first_run profiling will naturally place all
these ELF section. */ initialization code first. Using separate section is counter-productive
if (!in_lto_p || !flag_profile_values) because startup only code may call functions which are no longer
startup only. */
if (!in_lto_p
|| !cgraph_node::get (decl)->tp_first_run
|| !opt_for_fn (decl, flag_profile_reorder_functions))
return get_named_text_section (decl, ".text.startup", NULL); return get_named_text_section (decl, ".text.startup", NULL);
else else
return NULL; return NULL;
...@@ -607,10 +611,7 @@ default_function_section (tree decl, enum node_frequency freq, ...@@ -607,10 +611,7 @@ default_function_section (tree decl, enum node_frequency freq,
case NODE_FREQUENCY_UNLIKELY_EXECUTED: case NODE_FREQUENCY_UNLIKELY_EXECUTED:
return get_named_text_section (decl, ".text.unlikely", NULL); return get_named_text_section (decl, ".text.unlikely", NULL);
case NODE_FREQUENCY_HOT: case NODE_FREQUENCY_HOT:
/* If we do have a profile or(and) LTO phase is executed, we do not need return get_named_text_section (decl, ".text.hot", NULL);
these ELF section. */
if (!in_lto_p || !flag_profile_values)
return get_named_text_section (decl, ".text.hot", NULL);
/* FALLTHRU */ /* FALLTHRU */
default: default:
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment