This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

More function partitioning brokeness


Hi,
looking into darwin ICE introduced by my patch adding flag_reorder_functions test into
the function_section I noticed furhter brokeness in function partitoining code.

My change inadvertly made hot and cold sections to be equivalent with -fno-reorder-functions
that can be easily cured by making -freorder-blocks-and-partitions to imply function reordering
as it is what the pass is about anyway.

However the problem demonstrated itself as messup in the debug info.  This is because we expect
the hot & cold sections to be always different that is not always the case; such as for linkonce
or for user specified named section.

The code has some tests for this that are completely broken, such as setting global var
user_defined_section_attribute at parsing time and using it at optimization time clearing
at the end of RTL expansion that has possibly chance to partly work before unit-at-a-time
was introduced.

Since all the logic is now in the function_section code, we can simply check if the hot
and cold sections are different and disable the partitioning mahcinery when they are not.

This is done by adding new crtl flag partition_this_function.  While examing
all the numberous uses of flag_reorder_blocks_and_partition I noticed some
furhter brokeness, such as disabling of crossjumping even before function is
partitionined ur ugly named_sections tests spred across the compiler.  This
patch cleans things up.

The whole function partitioning code is rotten. I guess I will try to take over maintaining
it and get it fixed for 4.6 with profile info and make it work without for 4.7 by putting
i.e. exception handling code into cold sections.

The patch also avoids darwin from putting functions into cold sections when -freorder-functions
is not specified.

Bootstrapped/retgtested x86_64-linux. Would be possible to get this tested on darwin?
OK if that passes?

Honza

	PR target/46916
	* c-family/c-common.c: Remove set of user_defined_section_attribute.
	* final.c (rest_of_handle_final): Remove clear of user_defined_section_attribute.
	* toplev.c (user_defined_section_attribute): Remove.
	* toplev.h (user_defined_section_attribute): Remove.
	* hafa-sched.c (sched_create_recovery_edges): Use crtl->partition_this_function.
	* dbxout.c (dbxout_function_end): Likewise.
	* dwarf2out.c (dwarf2out_begin_prologue): Likewise.
	(gen_subprogram_die): Likewise.	
	(dwarf2out_begin_function): Likewise.
	* opts.c (finish_options): Set flag_reorder_function when
	lag_reorder_blocks_and_partition.
	* function.h (rtl_data): Add partition_this_function.
	* except.c (convert_to_eh_region_ranges): Use crtl->partition_this_function.
	* cfgcleanup.c (try_crossjump_to_edge): Likewise.
	* varasm.c (assemble_start_function): Likewise.
	(assemble_end_function): Likewise.
	* bb-reorder.c: Do not include toplev.h.
	(better_edge_p): Do use crtl->partition_this_function.
	(connect_traces): Likewise.
	(verify_hot_cold_block_grouping): Define only when checking.
	(reorder_basic_blocks): Verify only when checking.
	(insert_section_boundary_note): Use crtl->partition_this_function;
	clear it when function is not partitioned after all.
	(gate_handle_reorder_blocks): Add proper conditoinal here instead
	of checking it at the beggining of rest_of_handle_reorder_blocks.
	(rest_of_handle_reorder_blocks): Call set_partition_this_function; do not test flag_reorder_blocks.
	(gate_handle_partition_blocks): Use crtl->partition_this_function.
	* cfgrtl.c (force_nonfallthru_and_redirect): Likewise.
	(commit_one_edge_insertion): Likewise.
	* config/darwin.c (darwin_text_section): Do not care about unlikely sections.
	(machopic_select_section): Update call of darwin_text_section.
Index: c-family/c-common.c
===================================================================
*** c-family/c-common.c	(revision 167805)
--- c-family/c-common.c	(working copy)
*************** handle_section_attribute (tree *node, tr
*** 6505,6512 ****
  
    if (targetm.have_named_sections)
      {
-       user_defined_section_attribute = true;
- 
        if ((TREE_CODE (decl) == FUNCTION_DECL
  	   || TREE_CODE (decl) == VAR_DECL)
  	  && TREE_CODE (TREE_VALUE (args)) == STRING_CST)
--- 6505,6510 ----
Index: final.c
===================================================================
*** final.c	(revision 167805)
--- final.c	(working copy)
*************** rest_of_handle_final (void)
*** 4262,4269 ****
  
    assemble_end_function (current_function_decl, fnname);
  
-   user_defined_section_attribute = false;
- 
    /* Free up reg info memory.  */
    free_reg_info ();
  
--- 4262,4267 ----
Index: toplev.c
===================================================================
*** toplev.c	(revision 167805)
--- toplev.c	(working copy)
*************** int flag_permissive = 0;
*** 170,180 ****
     the support provided depends on the backend.  */
  rtx stack_limit_rtx;
  
- /* True if the user has tagged the function with the 'section'
-    attribute.  */
- 
- bool user_defined_section_attribute = false;
- 
  struct target_flag_state default_target_flag_state;
  #if SWITCHABLE_TARGET
  struct target_flag_state *this_target_flag_state = &default_target_flag_state;
--- 170,175 ----
Index: toplev.h
===================================================================
*** toplev.h	(revision 167805)
--- toplev.h	(working copy)
*************** extern void target_reinit (void);
*** 56,66 ****
  /* A unique local time stamp, might be zero if none is available.  */
  extern unsigned local_tick;
  
- /* True if the user has tagged the function with the 'section'
-    attribute.  */
- 
- extern bool user_defined_section_attribute;
- 
  /* See toplev.c.  */
  extern int flag_rerun_cse_after_global_opts;
  
--- 56,61 ----
Index: haifa-sched.c
===================================================================
*** haifa-sched.c	(revision 167805)
--- haifa-sched.c	(working copy)
*************** sched_create_recovery_edges (basic_block
*** 4454,4461 ****
      /* Partition type is the same, if it is "unpartitioned".  */
      {
        /* Rewritten from cfgrtl.c.  */
!       if (flag_reorder_blocks_and_partition
! 	  && targetm.have_named_sections)
  	{
  	  /* We don't need the same note for the check because
  	     any_condjump_p (check) == true.  */
--- 4454,4460 ----
      /* Partition type is the same, if it is "unpartitioned".  */
      {
        /* Rewritten from cfgrtl.c.  */
!       if (crtl->partition_this_function)
  	{
  	  /* We don't need the same note for the check because
  	     any_condjump_p (check) == true.  */
Index: dbxout.c
===================================================================
*** dbxout.c	(revision 167805)
--- dbxout.c	(working copy)
*************** dbxout_function_end (tree decl ATTRIBUTE
*** 944,950 ****
  
    /* By convention, GCC will mark the end of a function with an N_FUN
       symbol and an empty string.  */
!   if (flag_reorder_blocks_and_partition)
      {
        dbxout_begin_empty_stabs (N_FUN);
        dbxout_stab_value_label_diff (crtl->subsections.hot_section_end_label,
--- 944,950 ----
  
    /* By convention, GCC will mark the end of a function with an N_FUN
       symbol and an empty string.  */
!   if (crtl->partition_this_function)
      {
        dbxout_begin_empty_stabs (N_FUN);
        dbxout_stab_value_label_diff (crtl->subsections.hot_section_end_label,
Index: dwarf2out.c
===================================================================
*** dwarf2out.c	(revision 167805)
--- dwarf2out.c	(working copy)
*************** dwarf2out_begin_prologue (unsigned int l
*** 4122,4128 ****
    fde->nothrow = crtl->nothrow;
    fde->drap_reg = INVALID_REGNUM;
    fde->vdrap_reg = INVALID_REGNUM;
!   if (flag_reorder_blocks_and_partition)
      {
        section *unlikelysec;
        if (first_function_block_is_cold)
--- 4122,4128 ----
    fde->nothrow = crtl->nothrow;
    fde->drap_reg = INVALID_REGNUM;
    fde->vdrap_reg = INVALID_REGNUM;
!   if (crtl->partition_this_function)
      {
        section *unlikelysec;
        if (first_function_block_is_cold)
*************** gen_subprogram_die (tree decl, dw_die_re
*** 19065,19071 ****
        if (!old_die || !get_AT (old_die, DW_AT_inline))
  	equate_decl_number_to_die (decl, subr_die);
  
!       if (!flag_reorder_blocks_and_partition)
  	{
  	  ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_BEGIN_LABEL,
  				       current_function_funcdef_no);
--- 19065,19071 ----
        if (!old_die || !get_AT (old_die, DW_AT_inline))
  	equate_decl_number_to_die (decl, subr_die);
  
!       if (crtl->partition_this_function)
  	{
  	  ASM_GENERATE_INTERNAL_LABEL (label_id, FUNC_BEGIN_LABEL,
  				       current_function_funcdef_no);
*************** dwarf2out_begin_function (tree fun)
*** 21711,21717 ****
  {
    if (function_section (fun) != text_section)
      have_multiple_function_sections = true;
!   else if (flag_reorder_blocks_and_partition && !cold_text_section)
      {
        gcc_assert (current_function_decl == fun);
        cold_text_section = unlikely_text_section ();
--- 21711,21717 ----
  {
    if (function_section (fun) != text_section)
      have_multiple_function_sections = true;
!   else if (crtl->partition_this_function && !cold_text_section)
      {
        gcc_assert (current_function_decl == fun);
        cold_text_section = unlikely_text_section ();
Index: opts.c
===================================================================
*** opts.c	(revision 167805)
--- opts.c	(working copy)
*************** finish_options (struct gcc_options *opts
*** 755,760 ****
--- 755,764 ----
        opts->x_flag_reorder_blocks = 1;
      }
  
+   /* flag_reorder_blocks_and_partition imply function reordering.  */
+   if (opts->x_flag_reorder_blocks_and_partition)
+     opts->x_flag_reorder_functions = 1;
+ 
    /* Pipelining of outer loops is only possible when general pipelining
       capabilities are requested.  */
    if (!opts->x_flag_sel_sched_pipelining)
Index: function.h
===================================================================
*** function.h	(revision 167805)
--- function.h	(working copy)
*************** struct GTY(()) rtl_data {
*** 439,444 ****
--- 439,448 ----
       to eliminable regs (like the frame pointer) are set if an asm
       sets them.  */
    HARD_REG_SET asm_clobbers;
+ 
+   /* Set to true when this function has hot&cold partition.  Decided by BB reorder
+      and partitioning pass.  */
+   bool partition_this_function;
  };
  
  #define return_label (crtl->x_return_label)
Index: except.c
===================================================================
*** except.c	(revision 167805)
--- except.c	(working copy)
*************** convert_to_eh_region_ranges (void)
*** 2479,2485 ****
  	     && NOTE_KIND (iter) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
        {
  	gcc_assert (section_switch_note == NULL_RTX);
! 	gcc_assert (flag_reorder_blocks_and_partition);
  	section_switch_note = iter;
  	if (first_no_action_insn)
  	  {
--- 2479,2485 ----
  	     && NOTE_KIND (iter) == NOTE_INSN_SWITCH_TEXT_SECTIONS)
        {
  	gcc_assert (section_switch_note == NULL_RTX);
! 	gcc_assert (crtl->partition_this_function);
  	section_switch_note = iter;
  	if (first_no_action_insn)
  	  {
Index: cfgcleanup.c
===================================================================
*** cfgcleanup.c	(revision 167805)
--- cfgcleanup.c	(working copy)
*************** try_crossjump_to_edge (int mode, edge e1
*** 1590,1596 ****
       partition boundaries).  See the comments at the top of
       bb-reorder.c:partition_hot_cold_basic_blocks for complete details.  */
  
!   if (flag_reorder_blocks_and_partition && reload_completed)
      return false;
  
    /* Search backward through forwarder blocks.  We don't need to worry
--- 1590,1596 ----
       partition boundaries).  See the comments at the top of
       bb-reorder.c:partition_hot_cold_basic_blocks for complete details.  */
  
!   if (crtl->partition_this_function)
      return false;
  
    /* Search backward through forwarder blocks.  We don't need to worry
Index: varasm.c
===================================================================
*** varasm.c	(revision 167805)
--- varasm.c	(working copy)
*************** assemble_start_function (tree decl, cons
*** 1524,1530 ****
    bool hot_label_written = false;
  
    first_function_block_is_cold = false;
!   if (flag_reorder_blocks_and_partition)
      {
        ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTB", const_labelno);
        crtl->subsections.hot_section_label = ggc_strdup (tmp_label);
--- 1524,1530 ----
    bool hot_label_written = false;
  
    first_function_block_is_cold = false;
!   if (crtl->partition_this_function)
      {
        ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTB", const_labelno);
        crtl->subsections.hot_section_label = ggc_strdup (tmp_label);
*************** assemble_start_function (tree decl, cons
*** 1556,1562 ****
       has both hot and cold sections, because we don't want to re-set
       the alignment when the section switch happens mid-function.  */
  
!   if (flag_reorder_blocks_and_partition)
      {
        switch_to_section (unlikely_text_section ());
        assemble_align (DECL_ALIGN (decl));
--- 1556,1562 ----
       has both hot and cold sections, because we don't want to re-set
       the alignment when the section switch happens mid-function.  */
  
!   if (crtl->partition_this_function)
      {
        switch_to_section (unlikely_text_section ());
        assemble_align (DECL_ALIGN (decl));
*************** assemble_start_function (tree decl, cons
*** 1589,1595 ****
    /* Switch to the correct text section for the start of the function.  */
  
    switch_to_section (function_section (decl));
!   if (flag_reorder_blocks_and_partition
        && !hot_label_written)
      ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_label);
  
--- 1589,1595 ----
    /* Switch to the correct text section for the start of the function.  */
  
    switch_to_section (function_section (decl));
!   if (crtl->partition_this_function
        && !hot_label_written)
      ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_label);
  
*************** assemble_end_function (tree decl, const 
*** 1656,1662 ****
  {
  #ifdef ASM_DECLARE_FUNCTION_SIZE
    /* We could have switched section in the middle of the function.  */
!   if (flag_reorder_blocks_and_partition)
      switch_to_section (function_section (decl));
    ASM_DECLARE_FUNCTION_SIZE (asm_out_file, fnname, decl);
  #endif
--- 1656,1662 ----
  {
  #ifdef ASM_DECLARE_FUNCTION_SIZE
    /* We could have switched section in the middle of the function.  */
!   if (crtl->partition_this_function)
      switch_to_section (function_section (decl));
    ASM_DECLARE_FUNCTION_SIZE (asm_out_file, fnname, decl);
  #endif
*************** assemble_end_function (tree decl, const 
*** 1667,1673 ****
      }
    /* Output labels for end of hot/cold text sections (to be used by
       debug info.)  */
!   if (flag_reorder_blocks_and_partition)
      {
        section *save_text_section;
  
--- 1667,1673 ----
      }
    /* Output labels for end of hot/cold text sections (to be used by
       debug info.)  */
!   if (crtl->partition_this_function)
      {
        section *save_text_section;
  
Index: bb-reorder.c
===================================================================
*** bb-reorder.c	(revision 167805)
--- bb-reorder.c	(working copy)
***************
*** 83,89 ****
  #include "expr.h"
  #include "params.h"
  #include "diagnostic-core.h"
- #include "toplev.h" /* user_defined_section_attribute */
  #include "tree-pass.h"
  #include "df.h"
  #include "bb-reorder.h"
--- 83,88 ----
*************** better_edge_p (const_basic_block bb, con
*** 887,893 ****
       non-crossing edges over crossing edges.  */
  
    if (!is_better_edge
!       && flag_reorder_blocks_and_partition
        && cur_best_edge
        && (cur_best_edge->flags & EDGE_CROSSING)
        && !(e->flags & EDGE_CROSSING))
--- 886,892 ----
       non-crossing edges over crossing edges.  */
  
    if (!is_better_edge
!       && crtl->partition_this_function
        && cur_best_edge
        && (cur_best_edge->flags & EDGE_CROSSING)
        && !(e->flags & EDGE_CROSSING))
*************** connect_traces (int n_traces, struct tra
*** 922,928 ****
    current_partition = BB_PARTITION (traces[0].first);
    two_passes = false;
  
!   if (flag_reorder_blocks_and_partition)
      for (i = 0; i < n_traces && !two_passes; i++)
        if (BB_PARTITION (traces[0].first)
  	  != BB_PARTITION (traces[i].first))
--- 921,927 ----
    current_partition = BB_PARTITION (traces[0].first);
    two_passes = false;
  
!   if (crtl->partition_this_function)
      for (i = 0; i < n_traces && !two_passes; i++)
        if (BB_PARTITION (traces[0].first)
  	  != BB_PARTITION (traces[i].first))
*************** connect_traces (int n_traces, struct tra
*** 1099,1105 ****
  		      }
  		  }
  
! 	      if (flag_reorder_blocks_and_partition)
  		try_copy = false;
  
  	      /* Copy tiny blocks always; copy larger blocks only when the
--- 1098,1104 ----
  		      }
  		  }
  
! 	      if (crtl->partition_this_function)
  		try_copy = false;
  
  	      /* Copy tiny blocks always; copy larger blocks only when the
*************** fix_edges_for_rarely_executed_code (edge
*** 1861,1866 ****
--- 1860,1866 ----
    add_reg_crossing_jump_notes ();
  }
  
+ #ifdef ENABLE_CHECKING
  /* Verify, in the basic block chain, that there is at most one switch
     between hot/cold partitions. This is modelled on
     rtl_verify_flow_info_1, but it cannot go inside that function
*************** verify_hot_cold_block_grouping (void)
*** 1897,1902 ****
--- 1897,1903 ----
  
    gcc_assert(!err);
  }
+ #endif
  
  /* Reorder basic blocks.  The main entry point to this file.  FLAGS is
     the set of flags to pass to cfg_layout_initialize().  */
*************** reorder_basic_blocks (void)
*** 1945,1952 ****
    if (dump_file)
      dump_flow_info (dump_file, dump_flags);
  
!   if (flag_reorder_blocks_and_partition)
      verify_hot_cold_block_grouping ();
  }
  
  /* Determine which partition the first basic block in the function
--- 1946,1955 ----
    if (dump_file)
      dump_flow_info (dump_file, dump_flags);
  
! #ifdef ENABLE_CHECKING
!   if (crtl->partition_this_function)
      verify_hot_cold_block_grouping ();
+ #endif
  }
  
  /* Determine which partition the first basic block in the function
*************** insert_section_boundary_note (void)
*** 1964,1983 ****
    rtx new_note;
    int first_partition = 0;
  
!   if (flag_reorder_blocks_and_partition)
!     FOR_EACH_BB (bb)
      {
!       if (!first_partition)
! 	first_partition = BB_PARTITION (bb);
!       if (BB_PARTITION (bb) != first_partition)
! 	{
! 	  new_note = emit_note_before (NOTE_INSN_SWITCH_TEXT_SECTIONS,
! 				       BB_HEAD (bb));
! 	  /* ??? This kind of note always lives between basic blocks,
! 	     but add_insn_before will set BLOCK_FOR_INSN anyway.  */
! 	  BLOCK_FOR_INSN (new_note) = NULL;
! 	  break;
! 	}
      }
  }
  
--- 1967,1992 ----
    rtx new_note;
    int first_partition = 0;
  
!   if (crtl->partition_this_function)
      {
!       FOR_EACH_BB (bb)
!         {
!           if (!first_partition)
! 	    first_partition = BB_PARTITION (bb);
!           if (BB_PARTITION (bb) != first_partition)
! 	    {
! 	      new_note = emit_note_before (NOTE_INSN_SWITCH_TEXT_SECTIONS,
! 				           BB_HEAD (bb));
! 	      /* ??? This kind of note always lives between basic blocks,
! 	         but add_insn_before will set BLOCK_FOR_INSN anyway.  */
! 	      BLOCK_FOR_INSN (new_note) = NULL;
! 	      break;
! 	    }
!         }
!       /* If we really never switched, disable hot/cold partitioning for this function.
!          this save some overhead in dwarf2out and final.  */
!       if (!bb && first_partition != BB_COLD_PARTITION)
!        crtl->partition_this_function = false;
      }
  }
  
*************** gate_handle_reorder_blocks (void)
*** 2207,2213 ****
  {
    if (targetm.cannot_modify_jumps_p ())
      return false;
!   return (optimize > 0);
  }
  
  
--- 2216,2246 ----
  {
    if (targetm.cannot_modify_jumps_p ())
      return false;
!   /* Don't reorder blocks when optimizing for size because extra jump insns may
!      be created; also barrier may create extra padding.
! 
!      More correctly we should have a block reordering mode that tried to
!      minimize the combined size of all the jumps.  This would more or less
!      automatically remove extra jumps, but would also try to use more short
!      jumps instead of long jumps.  */
!   return (flag_reorder_blocks && optimize_function_for_speed_p (cfun));
! }
! 
! /* See if this function can have hot and cold section.
!    There are several cases when this is not possible (such as functions in user defined
!    named sections, or linkonce GNU sections).  In these cases target code leads to same
!    unlikely section as text section.  */
! 
! static void
! set_partition_this_function (void)
! {
!   if (!flag_reorder_blocks_and_partition)
!     crtl->partition_this_function = 0;
!   else
!     {
!       in_cold_section_p = false;
!       crtl->partition_this_function = current_function_section () != unlikely_text_section ();
!     }
  }
  
  
*************** rest_of_handle_reorder_blocks (void)
*** 2221,2239 ****
       splitting possibly introduced more crossjumping opportunities.  */
    cfg_layout_initialize (CLEANUP_EXPENSIVE);
  
!   if ((flag_reorder_blocks || flag_reorder_blocks_and_partition)
!       /* Don't reorder blocks when optimizing for size because extra jump insns may
! 	 be created; also barrier may create extra padding.
! 
! 	 More correctly we should have a block reordering mode that tried to
! 	 minimize the combined size of all the jumps.  This would more or less
! 	 automatically remove extra jumps, but would also try to use more short
! 	 jumps instead of long jumps.  */
!       && optimize_function_for_speed_p (cfun))
!     {
!       reorder_basic_blocks ();
!       cleanup_cfg (CLEANUP_EXPENSIVE);
!     }
  
    FOR_EACH_BB (bb)
      if (bb->next_bb != EXIT_BLOCK_PTR)
--- 2254,2263 ----
       splitting possibly introduced more crossjumping opportunities.  */
    cfg_layout_initialize (CLEANUP_EXPENSIVE);
  
!   set_partition_this_function ();
! 
!   reorder_basic_blocks ();
!   cleanup_cfg (CLEANUP_EXPENSIVE);
  
    FOR_EACH_BB (bb)
      if (bb->next_bb != EXIT_BLOCK_PTR)
*************** struct rtl_opt_pass pass_reorder_blocks 
*** 2267,2280 ****
  static bool
  gate_handle_partition_blocks (void)
  {
!   /* The optimization to partition hot/cold basic blocks into separate
!      sections of the .o file does not work well with linkonce or with
!      user defined section attributes.  Don't call it if either case
!      arises.  */
! 
!   return (flag_reorder_blocks_and_partition
! 	  && !DECL_ONE_ONLY (current_function_decl)
! 	  && !user_defined_section_attribute);
  }
  
  /* Partition hot and cold basic blocks.  */
--- 2291,2297 ----
  static bool
  gate_handle_partition_blocks (void)
  {
!   return crtl->partition_this_function;
  }
  
  /* Partition hot and cold basic blocks.  */
Index: config/darwin.c
===================================================================
*** config/darwin.c	(revision 167805)
--- config/darwin.c	(working copy)
*************** darwin_mark_decl_preserved (const char *
*** 1145,1160 ****
  }
  
  static section *
! darwin_text_section (int reloc, int weak)
  {
!   if (reloc)
!     return (weak
! 	    ? darwin_sections[text_unlikely_coal_section]
! 	    : unlikely_text_section ());
!   else
!     return (weak
! 	    ? darwin_sections[text_coal_section]
! 	    : text_section);
  }
  
  static section *
--- 1145,1155 ----
  }
  
  static section *
! darwin_text_section (int weak)
  {
!   return (weak
! 	  ? darwin_sections[text_coal_section]
! 	  : text_section);
  }
  
  static section *
*************** machopic_select_section (tree decl,
*** 1276,1282 ****
  						  node->only_called_at_startup,
  						  node->only_called_at_exit);
  	if (!base_section)
!           base_section = darwin_text_section (reloc, weak);
        }
        break;
  
--- 1271,1277 ----
  						  node->only_called_at_startup,
  						  node->only_called_at_exit);
  	if (!base_section)
!           base_section = darwin_text_section (reloc);
        }
        break;
  
Index: cfgrtl.c
===================================================================
*** cfgrtl.c	(revision 167805)
--- cfgrtl.c	(working copy)
*************** force_nonfallthru_and_redirect (edge e, 
*** 1221,1228 ****
        /* Make sure new block ends up in correct hot/cold section.  */
  
        BB_COPY_PARTITION (jump_block, e->src);
!       if (flag_reorder_blocks_and_partition
! 	  && targetm.have_named_sections
  	  && JUMP_P (BB_END (jump_block))
  	  && !any_condjump_p (BB_END (jump_block))
  	  && (EDGE_SUCC (jump_block, 0)->flags & EDGE_CROSSING))
--- 1221,1227 ----
        /* Make sure new block ends up in correct hot/cold section.  */
  
        BB_COPY_PARTITION (jump_block, e->src);
!       if (crtl->partition_this_function
  	  && JUMP_P (BB_END (jump_block))
  	  && !any_condjump_p (BB_END (jump_block))
  	  && (EDGE_SUCC (jump_block, 0)->flags & EDGE_CROSSING))
*************** commit_one_edge_insertion (edge e)
*** 1523,1530 ****
  	  bb = split_edge (e);
  	  after = BB_END (bb);
  
! 	  if (flag_reorder_blocks_and_partition
! 	      && targetm.have_named_sections
  	      && e->src != ENTRY_BLOCK_PTR
  	      && BB_PARTITION (e->src) == BB_COLD_PARTITION
  	      && !(e->flags & EDGE_CROSSING)
--- 1522,1528 ----
  	  bb = split_edge (e);
  	  after = BB_END (bb);
  
! 	  if (crtl->partition_this_function
  	      && e->src != ENTRY_BLOCK_PTR
  	      && BB_PARTITION (e->src) == BB_COLD_PARTITION
  	      && !(e->flags & EDGE_CROSSING)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]