From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 28EC53943429; Fri, 14 May 2021 14:57:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28EC53943429 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] early-remat.c: Fix new/delete mismatch [PR100230] X-Act-Checkin: gcc X-Git-Author: Alex Coplan X-Git-Refname: refs/vendors/redhat/heads/gcc-8-branch X-Git-Oldrev: 4aad1dc589ba5a47123d4b0d3eb92b0d8ef13c8b X-Git-Newrev: 65c5624fe5853138183064e554a301512a0764df Message-Id: <20210514145708.28EC53943429@sourceware.org> Date: Fri, 14 May 2021 14:57:08 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2021 14:57:08 -0000 https://gcc.gnu.org/g:65c5624fe5853138183064e554a301512a0764df commit 65c5624fe5853138183064e554a301512a0764df Author: Alex Coplan Date: Fri Apr 23 14:09:15 2021 +0100 early-remat.c: Fix new/delete mismatch [PR100230] This simple patch fixes a mistmatched operator new/delete in early-remat.c which triggers ASan errors on (at least) AArch64 when compiling SVE code. gcc/ChangeLog: PR rtl-optimization/100230 * early-remat.c (early_remat::sort_candidates): Use delete[] instead of delete for array allocated with new[]. (cherry picked from commit 5d87c2251c441f056e0a44f928ffcb8a8a679b6b) Diff: --- gcc/early-remat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/early-remat.c b/gcc/early-remat.c index bba2c1a6db5..177dd424d7b 100644 --- a/gcc/early-remat.c +++ b/gcc/early-remat.c @@ -1069,7 +1069,7 @@ early_remat::sort_candidates (void) m_candidates.qsort (compare_candidates); - delete postorder_index; + delete[] postorder_index; } /* Commit to the current candidate indices and initialize cross-references. */