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]

your libgcov patch


Zdenek,
your patch
2003-02-26  Zdenek Dvorak  <rakdver at atrey dot karlin dot mff dot cuni dot cz>
replaced the in-place increment of counters with a separate buffer.

these bits ...
>       counters = malloc (sizeof (gcov_type *) * ptr->n_counter_sections);
>       for (ix = 0; ix < ptr->n_counter_sections; ix++)
> 	counters[ix] = ptr->counter_sections[ix].counters;
and
	
<		for (jx = fn_info->n_arc_counts; jx--; count_ptr++)
< 		  if (gcov_read_counter (da_file, &count))
  		    goto read_error;
< 		  else
< 		    *count_ptr += count;
---
> 		  for (jx = fn_info->counter_sections[f_sect_index].n_counters;
> 		       jx--; counters[sect_index]++)
> 		    if (gcov_read_counter (da_file, &count))
> 		      goto read_error;
> 		    else
> 		      *counters[sect_index] += count;

why is that necessary?

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan at codesourcery dot com : http://www.cs.bris.ac.uk/~nathan/ : nathan at acm dot org



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