diff options
author | Richard Biener <rguenther@suse.de> | 2020-02-27 13:42:56 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-02-27 13:44:03 +0100 |
commit | e840185b31e40466e1575507200e1600e2343454 (patch) | |
tree | d9f4fc8a6dbc7fb275622cda08714858b6c0bdc7 /gcc/tree-vect-slp.c | |
parent | 82863a5cc99143f93203b2caed3750c7313a87ea (diff) |
tree-optimization/93953 - avoid reference into hash-map
When possibly expanding a hash-map avoid keeping a reference to an
entry.
2020-02-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/93953
* tree-vect-slp.c (slp_copy_subtree): Avoid keeping a reference
to the hash-map entry.
* gcc.dg/pr93953.c: New testcase.
Diffstat (limited to 'gcc/tree-vect-slp.c')
-rw-r--r-- | gcc/tree-vect-slp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index c7ddd94b39f..9d17e3386fa 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -1764,11 +1764,12 @@ slp_copy_subtree (slp_tree node, hash_map<slp_tree, slp_tree> &map) unsigned i; bool existed_p; - slp_tree © = map.get_or_insert (node, &existed_p); + slp_tree ©_ref = map.get_or_insert (node, &existed_p); if (existed_p) - return copy; + return copy_ref; - copy = XNEW (_slp_tree); + copy_ref = XNEW (_slp_tree); + slp_tree copy = copy_ref; memcpy (copy, node, sizeof (_slp_tree)); if (SLP_TREE_SCALAR_STMTS (node).exists ()) { |