GCC with patches for Dreamcast
Revision | 1807c381d5dee44f24a07472d350a58f016cd5f5 (tree) |
---|---|
Time | 2021-05-05 18:16:07 |
Author | Alex Coplan <alex.coplan@arm....> |
Commiter | Alex Coplan |
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)
@@ -1069,7 +1069,7 @@ early_remat::sort_candidates (void) | ||
1069 | 1069 | |
1070 | 1070 | m_candidates.qsort (compare_candidates); |
1071 | 1071 | |
1072 | - delete postorder_index; | |
1072 | + delete[] postorder_index; | |
1073 | 1073 | } |
1074 | 1074 | |
1075 | 1075 | /* Commit to the current candidate indices and initialize cross-references. */ |