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]

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))


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