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]

fix for crash with profile feedback


Hi,
I am installing the attached patch as obvious.  With
-fbranch-probabilities we split functions into different named sections
according to their frequency, however this conflict with linkonce usage
that is more important.  The attached patch disables the split when
linkonce is used.

Honza

Thu Oct  3 20:45:20 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* predict.c (choose_function_section): Avoid choice for linkonce functions.
Index: predict.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/predict.c,v
retrieving revision 1.73
diff -c -3 -p -r1.73 predict.c
*** predict.c	21 Jul 2002 22:01:58 -0000	1.73
--- predict.c	3 Oct 2002 18:45:15 -0000
*************** static void
*** 1247,1253 ****
  choose_function_section ()
  {
    if (DECL_SECTION_NAME (current_function_decl)
!       || !targetm.have_named_sections)
      return;
    if (cfun->function_frequency == FUNCTION_FREQUENCY_HOT)
      DECL_SECTION_NAME (current_function_decl) =
--- 1247,1258 ----
  choose_function_section ()
  {
    if (DECL_SECTION_NAME (current_function_decl)
!       || !targetm.have_named_sections
!       /* Theoretically we can split the gnu.linkonce text section too,
!  	 but this requires more work as the frequency needs to match
! 	 for all generated objects so we need to merge the frequency
! 	 of all instances.  For now just never set frequency for these.  */
!       || !DECL_ONE_ONLY (current_function_decl))
      return;
    if (cfun->function_frequency == FUNCTION_FREQUENCY_HOT)
      DECL_SECTION_NAME (current_function_decl) =


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