From: Sergei Trofimovich Date: Fri, 4 Sep 2020 21:20:57 +0000 (+0100) Subject: profile: clarify comment around histogram format X-Git-Tag: basepoints/gcc-12~4986 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f234870e1ca68ee793a3094cb9b2ab89addf8d43;p=thirdparty%2Fgcc.git profile: clarify comment around histogram format gcc/ChangeLog: * profile.c (sort_hist_values): Clarify hist format: start with a value, not counter. --- diff --git a/gcc/profile.c b/gcc/profile.c index f5c206813c7e..fe8963cc9e93 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -771,7 +771,7 @@ sort_hist_values (histogram_value hist) int counters = hist->hvalue.counters[1]; for (int i = 0; i < counters - 1; i++) /* Hist value is organized as: - [total_executions, N, counter1, ..., valueN, counterN] + [total_executions, N, value1, counter1, ..., valueN, counterN] Use decrease bubble sort to rearrange it. The sort starts from and compares counter first. If counter is same, compares the value, exchange it if small to keep stable. */