This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Profile merging code fix
- From: Jan Hubicka <jh at suse dot cz>
- To: nathan at codesourcery dot com, gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Date: Fri, 23 Aug 2002 21:41:05 +0200
- Subject: Profile merging code fix
Hi,
the merging code in __bb_exit_func contains bug of not storing merget
statistics. We will also need to add new field containing number of runs
merged into the file to stop confusing GCC's feedback. I will send separate
patch for that.
Honza
Pá srp 23 21:38:58 CEST 2002 Jan Hubicka <jh@suse.cz>
* libgcc2.c (__bb_exit_func): Properly write the summarized statistics.
Index: libgcc2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/libgcc2.c,v
retrieving revision 1.147
diff -c -3 -p -r1.147 libgcc2.c
*** libgcc2.c 14 Aug 2002 03:16:04 -0000 1.147
--- libgcc2.c 23 Aug 2002 19:38:30 -0000
*************** __bb_exit_func (void)
*** 1514,1524 ****
if (fseek (da_file, 4 * 3, SEEK_SET)
/* number of instrumented arcs. */
! || __write_long (program_arcs, da_file, 4)
/* sum of counters. */
! || __write_gcov_type (program_sum, da_file, 8)
/* maximal counter. */
! || __write_gcov_type (program_max, da_file, 8))
fprintf (stderr, "arc profiling: Error updating program header %s.\n",
ptr->filename);
if (fclose (da_file))
--- 1514,1524 ----
if (fseek (da_file, 4 * 3, SEEK_SET)
/* number of instrumented arcs. */
! || __write_long (merged_arcs, da_file, 4)
/* sum of counters. */
! || __write_gcov_type (merged_sum, da_file, 8)
/* maximal counter. */
! || __write_gcov_type (merged_max, da_file, 8))
fprintf (stderr, "arc profiling: Error updating program header %s.\n",
ptr->filename);
if (fclose (da_file))