https://gcc.gnu.org/g:fd883919b2644c16a6bb00ba39bcba98cc26979d

commit r15-4193-gfd883919b2644c16a6bb00ba39bcba98cc26979d
Author: Richard Biener <rguent...@suse.de>
Date:   Tue Oct 8 14:24:27 2024 +0200

    Fix memory leak in vect_cse_slp_nodes
    
    The following avoids copying scalar stmts again for the re-lookup
    of the slot to replace the NULL guard with node.
    
            * tree-vect-slp.cc (vect_cse_slp_nodes): Fix memory leak.

Diff:
---
 gcc/tree-vect-slp.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 849863c15057..44ce9dbbab2d 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -7024,7 +7024,7 @@ vect_cse_slp_nodes (scalar_stmts_to_slp_tree_map_t 
*bst_map, slp_tree& node)
 
   /* Now record the node for CSE in other siblings.  */
   if (put_p)
-    bst_map->put (SLP_TREE_SCALAR_STMTS (node).copy (), node);
+    *bst_map->get (SLP_TREE_SCALAR_STMTS (node)) = node;
 }
 
 /* Optimize the SLP graph of VINFO.  */

Reply via email to