From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7880) id CFA63385783F; Thu, 16 Feb 2023 16:28:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFA63385783F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676564931; bh=buxMznQnhcFnByKaoU+vRmKdWC2JvlSChfkKuEw9UMw=; h=From:To:Subject:Date:From; b=jA4gBYxIG9WgCdVpA2zbYyAqLkpZwUrKrA+eJT8XGRuc5I/zEHX4Sw72QVnHep+V1 8CQAWc3DJTjkFwJ/6aK/YScaHJfGETaJy1+Qh4zVR88YYyV7D5EiSHQDXbtNpd9gzA WtLOPhjkcpB3qttKU9WX92JyMNinzNdCWna1PM6Y= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Ondrej Kubanek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/kubaneko/heads/histogram)] fixed vector allocation X-Act-Checkin: gcc X-Git-Author: kubaneko X-Git-Refname: refs/users/kubaneko/heads/histogram X-Git-Oldrev: ecc0d914e2c4875152cd7b00d3469ff40116af55 X-Git-Newrev: 18009000aa840b2c6d759334ab28a0e9fc07128d Message-Id: <20230216162851.CFA63385783F@sourceware.org> Date: Thu, 16 Feb 2023 16:28:51 +0000 (GMT) List-Id: https://gcc.gnu.org/g:18009000aa840b2c6d759334ab28a0e9fc07128d commit 18009000aa840b2c6d759334ab28a0e9fc07128d Author: kubaneko Date: Sat Jan 14 22:04:29 2023 +0000 fixed vector allocation Diff: --- gcc/cfgloop.h | 2 +- gcc/profile.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index 7483417a304..f74d3275d87 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -97,7 +97,7 @@ struct loop_exit_hasher : ggc_ptr_hash struct GTY(()) histogram_counters{ gcov_type sum; int histogram_size; - vec * GTY((skip)) hist; + vec * GTY((skip)) hist; }; // quantil function for the distribution diff --git a/gcc/profile.cc b/gcc/profile.cc index c754432f19b..5199dcec13a 100644 --- a/gcc/profile.cc +++ b/gcc/profile.cc @@ -930,13 +930,14 @@ compute_value_histograms (histogram_values values, unsigned cfg_checksum, if (act_count[t]){ lp->counters=ggc_alloc(); gcov_type sum=0; + lp->counters->hist=NULL; + vec_safe_grow_cleared(lp->counters->hist,param_profile_histogram_size); for (int i=0;icounters->hist; (*hst)[i]=act_count[t][i]; sum+=act_count[t][i]; } lp->counters->sum=sum; - vec_safe_grow_cleared(lp->counters->hist,param_profile_histogram_size); } continue; }