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: fix for crash with profile feedback


> 	I just tried to use -fbranch-probabilities and noticed that it no
> longer generates multiple sections.  When I investigated, I tracked it
> down to the patch
> 
> 	* predict.c (choose_function_section): Avoid choice for linkonce
> 	functions.
> 
> The logic in the statement
> 
> 	|| !DECL_ONE_ONLY (current_function_decl))
> 
> seems reversed and contradicts the comment.  I think the negation (!) is
> incorrect.  As it currently is written, no function section is set if
> DECL_ONE_ONLY is *unset*.  DECL_ONE_ONLY set means linkonce, so linkonce
> text sections *are* overridden.
Hmm, good catch!  I am fixing it as obvious.  Thanks.

Honza

Tue Feb 11 10:01:35 CET 2003  Jan Hubicka  <jh@suse.cz>
	* predict.c (choose_function_section): Choose sections correctly.
Index: predict.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/predict.c,v
retrieving revision 1.81
diff -c -3 -p -r1.81 predict.c
*** predict.c	10 Feb 2003 12:34:22 -0000	1.81
--- predict.c	11 Feb 2003 09:00:14 -0000
*************** choose_function_section ()
*** 1279,1285 ****
   	 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) =
--- 1279,1285 ----
   	 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]