https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110074
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2023-06-01 Ever confirmed|0 |1 Summary|code bloat with |-fprofile-arcs profiles |-fprofile-arcs + |arcs generated by |-fsanitize=bounds |-fsanitize=bounds --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Simplified example: ``` int array[104]; int f(int t) { return array[t]; } ``` Compile this at -fprofile-arcs -O2 -fsanitize=bounds and in .optimized we have: ``` PROF_edge_counter_5 = __gcov0._Z1fi[0]; PROF_edge_counter_6 = PROF_edge_counter_5 + 1; __gcov0._Z1fi[0] = PROF_edge_counter_6; # DEBUG BEGIN_STMT _11 = (sizetype) t_1(D); if (_11 >= 104) goto <bb 3>; [0.05%] else goto <bb 4>; [99.95%] <bb 3> [local count: 536864]: _12 = (unsigned long) t_1(D); __builtin___ubsan_handle_out_of_bounds (&*.Lubsan_data0, _12); <bb 4> [local count: 1073741824]: PROF_edge_counter_7 = __gcov0._Z1fi[1]; PROF_edge_counter_8 = PROF_edge_counter_7 + 1; __gcov0._Z1fi[1] = PROF_edge_counter_8; _4 = array[t_1(D)]; ``` But we do really need to profile that arc?