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]

Re: AIX bootstrap failure (was Re: Hot/cold partitioning fixes)



On Apr 1, 2005, at 8:43 AM, David Edelsohn wrote:


The hot/cold partitioning patch is emitting hot and cold section
labels unconditionally, regardless whether reorder_blocks_and_partition is
enabled. The appended patch addresses that problem. I am attempting
another bootstrap now.


	Also, the implementation assumes that it can manipulate section
names by appending strings, which is fundamentally not portable.  This
functionality was not implemented portably for inclusion in GCC.

David


* varasm.c (assemble_start_function): Only emit hot_section_label if reorder_blocks_and_partition is enabled. (assemble_end_function): Only emit cold_section_end_label and hot_section_end_label if reorder_blocks_and_partition is enabled.

Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.492
diff -c -p -r1.492 varasm.c
*** varasm.c 1 Apr 2005 03:42:45 -0000 1.492
--- varasm.c 1 Apr 2005 16:37:59 -0000
*************** assemble_start_function (tree decl, cons
*** 1303,1309 ****
/* Switch to the correct text section for the start of the function. */


    function_section (decl);
!   if (!hot_label_written)
      ASM_OUTPUT_LABEL (asm_out_file, hot_section_label);

/* Tell assembler to move to target machine's alignment for functions. */
--- 1303,1309 ----
/* Switch to the correct text section for the start of the function. */


    function_section (decl);
!   if (flag_reorder_blocks_and_partition && !hot_label_written)
      ASM_OUTPUT_LABEL (asm_out_file, hot_section_label);

/* Tell assembler to move to target machine's alignment for functions. */
*************** assemble_end_function (tree decl, const
*** 1379,1387 ****
debug info.) */
save_text_section = in_section;
unlikely_text_section ();
! ASM_OUTPUT_LABEL (asm_out_file, cold_section_end_label);
text_section ();
! ASM_OUTPUT_LABEL (asm_out_file, hot_section_end_label);
if (save_text_section == in_unlikely_executed_text)
unlikely_text_section ();
}
--- 1379,1389 ----
debug info.) */
save_text_section = in_section;
unlikely_text_section ();
! if (flag_reorder_blocks_and_partition)
! ASM_OUTPUT_LABEL (asm_out_file, cold_section_end_label);
text_section ();
! if (flag_reorder_blocks_and_partition)
! ASM_OUTPUT_LABEL (asm_out_file, hot_section_end_label);
if (save_text_section == in_unlikely_executed_text)
unlikely_text_section ();
}

It would make more sense to put all the code that puts out labels and changes back and forth
between sections in assemble_end_function into a single condition block as shown below:


l*************** assemble_end_function (tree decl, const
*** 1377,1389 ****
      }
    /* Output labels for end of hot/cold text sections (to be used by
       debug info.)  */
!   save_text_section = in_section;
!   unlikely_text_section ();
!   ASM_OUTPUT_LABEL (asm_out_file, cold_section_end_label);
!   text_section ();
!   ASM_OUTPUT_LABEL (asm_out_file, hot_section_end_label);
!   if (save_text_section == in_unlikely_executed_text)
!     unlikely_text_section ();
  }


/* Assemble code to leave SIZE bytes of zeros. */ --- 1379,1394 ---- } /* Output labels for end of hot/cold text sections (to be used by debug info.) */ ! if (flag_reorder_blocks_and_partition) ! { ! save_text_section = in_section; ! unlikely_text_section (); ! ASM_OUTPUT_LABEL (asm_out_file, cold_section_end_label); ! text_section (); ! ASM_OUTPUT_LABEL (asm_out_file, hot_section_end_label); ! if (save_text_section == in_unlikely_executed_text) ! unlikely_text_section (); ! } }





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