This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix for crash with profile feedback
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 3 Oct 2002 21:33:39 +0200
- Subject: 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) =