Commit e840185b by Richard Biener

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.
parent 82863a5c
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.
2020-02-27 Andrew Stubbs <ams@codesourcery.com>
* config/gcn/gcn.md (mov<mode>): Add transformations for BI subregs.
......
2020-02-27 Richard Biener <rguenther@suse.de>
PR tree-optimization/93953
* gcc.dg/pr93953.c: New testcase.
2020-02-27 Jakub Jelinek <jakub@redhat.com>
PR c/93949
......
/* PR tree-optimization/93953 */
/* { dg-do compile } */
/* { dg-options "-O3 --param=ggc-min-expand=0 --param=ggc-min-heapsize=0" } */
int *b, c, e;
float d, g, f;
void
foo (int l)
{
for (; l; ++l)
{
float a = g > l;
d += a * b[4 * (l + c * e)];
f += a * b[4 * (l + c * e) + 1];
}
}
......@@ -1764,11 +1764,12 @@ slp_copy_subtree (slp_tree node, hash_map<slp_tree, slp_tree> &map)
unsigned i;
bool existed_p;
slp_tree &copy = map.get_or_insert (node, &existed_p);
slp_tree &copy_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 ())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment