Hi,

This simple patch fixes a mismatched operator new/delete in
early-remat.c which triggers ASan errors on (at least) AArch64 when
compiling SVE code.

Bootstrap and regtest on aarch64-linux-gnu in progress.

OK for trunk and backports (as appropriate) if testing looks good?

Thanks,
Alex

gcc/ChangeLog:

        PR rtl-optimization/100230
        * early-remat.c (early_remat::sort_candidates): Use delete[]
        instead of delete for array allocated with new[].
diff --git a/gcc/early-remat.c b/gcc/early-remat.c
index c8d4fee937d..92077d094ae 100644
--- a/gcc/early-remat.c
+++ b/gcc/early-remat.c
@@ -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.  */

Reply via email to