https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89307
--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> --- I'm just looking at the google/gcc-4.9 branch: https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.9/ and they have a sampling approach: /* Transform: ORIGINAL CODE Into: __gcov_sample_counter++; if (__gcov_sample_counter >= __gcov_sampling_period) { __gcov_sample_counter = 0; ORIGINAL CODE } which effectively updates edge counters just for a limited time. I would expect size increase: Removing basic block 9 Removing basic block 10 main (int argc) { unsigned int PROF_sample.2; unsigned int PROF_sample.1; long int PROF_edge_counter_6; long int PROF_edge_counter_7; long int PROF_edge_counter_8; long int PROF_edge_counter_9; <bb 2>: __gcov_indirect_call_profiler_v2 (1005944783, main); __gcov_indirect_call_callee = 0B; if (argc_2(D) != 0) goto <bb 3>; else goto <bb 6>; <bb 3>: a = 123; PROF_sample.2_13 = __gcov_sample_counter; PROF_sample.2_14 = PROF_sample.2_13 + 1; __gcov_sample_counter = PROF_sample.2_14; PROF_sample.2_15 = __gcov_sampling_period; if (PROF_sample.2_14 >= PROF_sample.2_15) goto <bb 5>; else goto <bb 4>; <bb 4>: goto <bb 8>; <bb 5>: __gcov_sample_counter = 0; PROF_edge_counter_6 = __gcov0.main[0]; PROF_edge_counter_7 = PROF_edge_counter_6 + 1; __gcov0.main[0] = PROF_edge_counter_7; goto <bb 8>; <bb 6>: a = 0; PROF_sample.1_10 = __gcov_sample_counter; PROF_sample.1_11 = PROF_sample.1_10 + 1; __gcov_sample_counter = PROF_sample.1_11; PROF_sample.1_12 = __gcov_sampling_period; if (PROF_sample.1_11 >= PROF_sample.1_12) goto <bb 7>; else goto <bb 4>; <bb 7>: __gcov_sample_counter = 0; PROF_edge_counter_8 = __gcov0.main[1]; PROF_edge_counter_9 = PROF_edge_counter_8 + 1; __gcov0.main[1] = PROF_edge_counter_9; <bb 8>: return 0; }