aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Coplan <alex.coplan@arm.com>2021-04-23 14:09:15 +0100
committerAlex Coplan <alex.coplan@arm.com>2021-05-05 10:16:07 +0100
commit1807c381d5dee44f24a07472d350a58f016cd5f5 (patch)
tree49c1a5271d843c45adbd38b4b2308911dc2b73a1
parent31e54868cd263b5361ecb18d8e40f66932cf1ee0 (diff)
downloadgcc-1807c381d5dee44f24a07472d350a58f016cd5f5.zip
gcc-1807c381d5dee44f24a07472d350a58f016cd5f5.tar.gz
gcc-1807c381d5dee44f24a07472d350a58f016cd5f5.tar.bz2
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)
-rw-r--r--gcc/early-remat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/early-remat.c b/gcc/early-remat.c
index bba2c1a..177dd42 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. */