On 08/08/16 12:56, Martin Liška wrote:
Hello.

Currently, we utilize pow2 profile histogram to track gimple STMTs like this: 
ssa_name_x % value.

void
__gcov_pow2_profiler (gcov_type *counters, gcov_type value)
{
  if (value & (value - 1))
    counters[0]++;
  else
    counters[1]++;
}

Although __gcov_pow2_profiler function wrongly handles 0 (which is not power of 
two), it's impossible
to write a test-case which would not expose a division by zero. As one can 
potentially use the same profiler
for a different purpose, I would like to fix it. Apart from that, we've got a 
small bug in a dump function
of the POW2 histograms.

Survives make check -k -j10 RUNTESTFLAGS="tree-prof.exp"
Ready for trunk?

Ok.

nathan

Reply via email to