]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
early-remat.c: Fix new/delete mismatch [PR100230]
authorAlex Coplan <alex.coplan@arm.com>
Fri, 23 Apr 2021 13:09:15 +0000 (14:09 +0100)
committerAlex Coplan <alex.coplan@arm.com>
Fri, 30 Apr 2021 17:35:29 +0000 (18:35 +0100)
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)

gcc/early-remat.c

index c8d4fee937d846570ee00ba7abb0acfa3f5b80ad..92077d094aed505832f122329dd838e6be45b390 100644 (file)
@@ -1059,7 +1059,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.  */