public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] early-remat.c: Fix new/delete mismatch [PR100230]
@ 2021-05-14 14:57 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-05-14 14:57 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:65c5624fe5853138183064e554a301512a0764df

commit 65c5624fe5853138183064e554a301512a0764df
Author: Alex Coplan <alex.coplan@arm.com>
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.  */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-14 14:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 14:57 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] early-remat.c: Fix new/delete mismatch [PR100230] Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).