This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix for crash with profile feedback
- From: Jan Hubicka <jh at suse dot cz>
- To: David Edelsohn <dje at watson dot ibm dot com>
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Feb 2003 10:03:37 +0100
- Subject: Re: fix for crash with profile feedback
- References: <20021003193339.GD5244@atrey.karlin.mff.cuni.cz> <200302110152.UAA29264@makai.watson.ibm.com>
> 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) =