Commit 0b6bc904 by Jan Hubicka Committed by Jan Hubicka

cfgrtl.c (cfg_layout_initialize): Check crtl->has_bb_partition instead of…

cfgrtl.c (cfg_layout_initialize): Check crtl->has_bb_partition instead of flag_reorder_blocks_and_partition.

	* cfgrtl.c (cfg_layout_initialize): Check crtl->has_bb_partition
	instead of flag_reorder_blocks_and_partition.
	* dbxout.c (dbxout_function_end): Likewise.
	* dwarf2out.c (gen_subprogram_die): Likewise.
	* haifa-sched.c (sched_create_recovery_edges): Likewise.
	* hw-doloop.c (reorg_loops): Likewise.
	* varasm.c (assemble_start_function,
	assemble_end_function): Likewise.
	(decide_function_section): Do not check for
	flag_reorder_blocks_and_partition.

From-SVN: r249017
parent 1ac644c8
2017-06-08 Jan Hubicka <hubicka@ucw.cz>
* cfgrtl.c (cfg_layout_initialize): Check crtl->has_bb_partition
instead of flag_reorder_blocks_and_partition.
* dbxout.c (dbxout_function_end): Likewise.
* dwarf2out.c (gen_subprogram_die): Likewise.
* haifa-sched.c (sched_create_recovery_edges): Likewise.
* hw-doloop.c (reorg_loops): Likewise.
* varasm.c (assemble_start_function,
assemble_end_function): Likewise.
(decide_function_section): Do not check for
flag_reorder_blocks_and_partition.
2017-06-08 Alexander Ivchenko <alexander.ivchenko@intel.com> 2017-06-08 Alexander Ivchenko <alexander.ivchenko@intel.com>
* tree-chkp.c (chkp_get_hard_register_var_fake_base_address): * tree-chkp.c (chkp_get_hard_register_var_fake_base_address):
......
...@@ -4249,8 +4249,7 @@ cfg_layout_initialize (int flags) ...@@ -4249,8 +4249,7 @@ cfg_layout_initialize (int flags)
layout required moving a block from the hot to the cold layout required moving a block from the hot to the cold
section. This would create an illegal partitioning unless some section. This would create an illegal partitioning unless some
manual fixup was performed. */ manual fixup was performed. */
gcc_assert (!(crtl->bb_reorder_complete gcc_assert (!crtl->bb_reorder_complete || !crtl->has_bb_partition);
&& flag_reorder_blocks_and_partition));
initialize_original_copy_tables (); initialize_original_copy_tables ();
......
...@@ -916,7 +916,7 @@ dbxout_function_end (tree decl ATTRIBUTE_UNUSED) ...@@ -916,7 +916,7 @@ dbxout_function_end (tree decl ATTRIBUTE_UNUSED)
/* By convention, GCC will mark the end of a function with an N_FUN /* By convention, GCC will mark the end of a function with an N_FUN
symbol and an empty string. */ symbol and an empty string. */
if (flag_reorder_blocks_and_partition) if (crtl->has_bb_partition)
{ {
dbxout_begin_empty_stabs (N_FUN); dbxout_begin_empty_stabs (N_FUN);
dbxout_stab_value_label_diff (crtl->subsections.hot_section_end_label, dbxout_stab_value_label_diff (crtl->subsections.hot_section_end_label,
......
...@@ -22152,7 +22152,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) ...@@ -22152,7 +22152,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
struct function *fun = DECL_STRUCT_FUNCTION (decl); struct function *fun = DECL_STRUCT_FUNCTION (decl);
if (!flag_reorder_blocks_and_partition) if (!crtl->has_bb_partition)
{ {
dw_fde_ref fde = fun->fde; dw_fde_ref fde = fun->fde;
if (fde->dw_fde_begin) if (fde->dw_fde_begin)
...@@ -26472,7 +26472,7 @@ set_cur_line_info_table (section *sec) ...@@ -26472,7 +26472,7 @@ set_cur_line_info_table (section *sec)
{ {
const char *end_label; const char *end_label;
if (flag_reorder_blocks_and_partition) if (crtl->has_bb_partition)
{ {
if (in_cold_section_p) if (in_cold_section_p)
end_label = crtl->subsections.cold_section_end_label; end_label = crtl->subsections.cold_section_end_label;
...@@ -26514,7 +26514,7 @@ dwarf2out_begin_function (tree fun) ...@@ -26514,7 +26514,7 @@ dwarf2out_begin_function (tree fun)
if (sec != text_section) if (sec != text_section)
have_multiple_function_sections = true; have_multiple_function_sections = true;
if (flag_reorder_blocks_and_partition && !cold_text_section) if (crtl->has_bb_partition && !cold_text_section)
{ {
gcc_assert (current_function_decl == fun); gcc_assert (current_function_decl == fun);
cold_text_section = unlikely_text_section (); cold_text_section = unlikely_text_section ();
......
...@@ -8313,8 +8313,7 @@ sched_create_recovery_edges (basic_block first_bb, basic_block rec, ...@@ -8313,8 +8313,7 @@ sched_create_recovery_edges (basic_block first_bb, basic_block rec,
/* Partition type is the same, if it is "unpartitioned". */ /* Partition type is the same, if it is "unpartitioned". */
{ {
/* Rewritten from cfgrtl.c. */ /* Rewritten from cfgrtl.c. */
if (flag_reorder_blocks_and_partition if (crtl->has_bb_partition && targetm_common.have_named_sections)
&& targetm_common.have_named_sections)
{ {
/* We don't need the same note for the check because /* We don't need the same note for the check because
any_condjump_p (check) == true. */ any_condjump_p (check) == true. */
......
...@@ -634,7 +634,7 @@ reorg_loops (bool do_reorder, struct hw_doloop_hooks *hooks) ...@@ -634,7 +634,7 @@ reorg_loops (bool do_reorder, struct hw_doloop_hooks *hooks)
/* We can't enter cfglayout mode anymore if basic block partitioning /* We can't enter cfglayout mode anymore if basic block partitioning
already happened. */ already happened. */
if (do_reorder && !flag_reorder_blocks_and_partition) if (do_reorder && !crtl->has_bb_partition)
{ {
reorder_loops (loops); reorder_loops (loops);
free_loops (loops); free_loops (loops);
......
...@@ -1670,10 +1670,6 @@ decide_function_section (tree decl) ...@@ -1670,10 +1670,6 @@ decide_function_section (tree decl)
{ {
first_function_block_is_cold = false; first_function_block_is_cold = false;
if (flag_reorder_blocks_and_partition)
/* We will decide in assemble_start_function. */
return;
if (DECL_SECTION_NAME (decl)) if (DECL_SECTION_NAME (decl))
{ {
struct cgraph_node *node = cgraph_node::get (current_function_decl); struct cgraph_node *node = cgraph_node::get (current_function_decl);
...@@ -1711,7 +1707,7 @@ assemble_start_function (tree decl, const char *fnname) ...@@ -1711,7 +1707,7 @@ assemble_start_function (tree decl, const char *fnname)
char tmp_label[100]; char tmp_label[100];
bool hot_label_written = false; bool hot_label_written = false;
if (flag_reorder_blocks_and_partition) if (crtl->has_bb_partition)
{ {
ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTB", const_labelno); ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTB", const_labelno);
crtl->subsections.hot_section_label = ggc_strdup (tmp_label); crtl->subsections.hot_section_label = ggc_strdup (tmp_label);
...@@ -1746,7 +1742,7 @@ assemble_start_function (tree decl, const char *fnname) ...@@ -1746,7 +1742,7 @@ assemble_start_function (tree decl, const char *fnname)
has both hot and cold sections, because we don't want to re-set has both hot and cold sections, because we don't want to re-set
the alignment when the section switch happens mid-function. */ the alignment when the section switch happens mid-function. */
if (flag_reorder_blocks_and_partition) if (crtl->has_bb_partition)
{ {
first_function_block_is_cold = false; first_function_block_is_cold = false;
...@@ -1773,8 +1769,7 @@ assemble_start_function (tree decl, const char *fnname) ...@@ -1773,8 +1769,7 @@ assemble_start_function (tree decl, const char *fnname)
/* Switch to the correct text section for the start of the function. */ /* Switch to the correct text section for the start of the function. */
switch_to_section (function_section (decl)); switch_to_section (function_section (decl));
if (flag_reorder_blocks_and_partition if (crtl->has_bb_partition && !hot_label_written)
&& !hot_label_written)
ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_label); ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_label);
/* Tell assembler to move to target machine's alignment for functions. */ /* Tell assembler to move to target machine's alignment for functions. */
...@@ -1850,7 +1845,7 @@ assemble_end_function (tree decl, const char *fnname ATTRIBUTE_UNUSED) ...@@ -1850,7 +1845,7 @@ assemble_end_function (tree decl, const char *fnname ATTRIBUTE_UNUSED)
{ {
#ifdef ASM_DECLARE_FUNCTION_SIZE #ifdef ASM_DECLARE_FUNCTION_SIZE
/* We could have switched section in the middle of the function. */ /* We could have switched section in the middle of the function. */
if (flag_reorder_blocks_and_partition) if (crtl->has_bb_partition)
switch_to_section (function_section (decl)); switch_to_section (function_section (decl));
ASM_DECLARE_FUNCTION_SIZE (asm_out_file, fnname, decl); ASM_DECLARE_FUNCTION_SIZE (asm_out_file, fnname, decl);
#endif #endif
...@@ -1861,7 +1856,7 @@ assemble_end_function (tree decl, const char *fnname ATTRIBUTE_UNUSED) ...@@ -1861,7 +1856,7 @@ assemble_end_function (tree decl, const char *fnname ATTRIBUTE_UNUSED)
} }
/* Output labels for end of hot/cold text sections (to be used by /* Output labels for end of hot/cold text sections (to be used by
debug info.) */ debug info.) */
if (flag_reorder_blocks_and_partition) if (crtl->has_bb_partition)
{ {
section *save_text_section; section *save_text_section;
......
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