http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53915
--- Comment #1 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> 2012-07-10 14:27:28 UTC --- The problem is probably in gcc/gcov.c, function format_gcov, which has: float ratio = bottom ? (float)top / bottom : 0; int ix; unsigned limit = 100; unsigned percent; for (ix = dp; ix--; ) limit *= 10; percent = (unsigned) (ratio * limit + (float)0.5); Using double instead of float would be a first improvement (2 occurrences in the first line, cast to be removed in the last line). Also, multiplying top by limit (after a cast to double) before dividing by bottom should be better, as the first operation (the multiplication) would be done exactly in practice. Something like that: percent = (unsigned) ((double) top * limit / bottom + 0.5); or even: percent = (unsigned) (((double) top * limit + (double) bottom / 2) / bottom);