aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2024-10-08 14:24:27 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2024-10-09 09:43:29 +0200
commitfd883919b2644c16a6bb00ba39bcba98cc26979d (patch)
tree769321d7aa92dad55bceb0d61f67292a9a31ae19
parent4b152f62e4acff41c6d0f1423f7f50e7a0528b5b (diff)
downloadgcc-fd883919b2644c16a6bb00ba39bcba98cc26979d.zip
gcc-fd883919b2644c16a6bb00ba39bcba98cc26979d.tar.gz
gcc-fd883919b2644c16a6bb00ba39bcba98cc26979d.tar.bz2
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.
-rw-r--r--gcc/tree-vect-slp.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 849863c..44ce9db 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. */