aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rwxr-xr-xgcc/testsuite/g++.dg/vect/pr99220.cc29
-rw-r--r--gcc/tree-vect-slp.c12
2 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/vect/pr99220.cc b/gcc/testsuite/g++.dg/vect/pr99220.cc
new file mode 100755
index 0000000..b41b2d4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr99220.cc
@@ -0,0 +1,29 @@
+/* { dg-do compile { target { aarch64*-*-* } } } */
+/* { dg-additional-options "-w -O3 -march=armv8.3-a" } */
+
+class a {
+ float b;
+ float c;
+
+public:
+ a(float d, float e) : b(d), c(e) {}
+ a operator+(a d) { return a(b + d.b, c + d.c); }
+ a operator-(a d) { return a(b - d.b, c - d.c); }
+ a operator*(a d) { return a(b * b - c * c, b * c + c * d.b); }
+};
+long f;
+a *g;
+class {
+ a *h;
+ long i;
+ a *j;
+
+public:
+ void k() {
+ a l = h[0], m = g[i], n = l * g[1], o = l * j[8];
+ g[i] = m + n;
+ g[i + 1] = m - n;
+ j[f] = o;
+ }
+} p;
+main() { p.k(); }
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 091e727..c55c01a 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -2351,6 +2351,12 @@ next:
{
SLP_TREE_REF_COUNT (value)++;
SLP_TREE_CHILDREN (root)[i] = value;
+ /* ??? We know the original leafs of the replaced nodes will
+ be referenced by bst_map, only the permutes created by
+ pattern matching are not. */
+ if (SLP_TREE_REF_COUNT (node) == 1)
+ load_map->remove (node);
+
vect_free_slp_tree (node);
}
}
@@ -2383,6 +2389,12 @@ optimize_load_redistribution (scalar_stmts_to_slp_tree_map_t *bst_map,
{
SLP_TREE_REF_COUNT (value)++;
SLP_TREE_CHILDREN (root)[i] = value;
+ /* ??? We know the original leafs of the replaced nodes will
+ be referenced by bst_map, only the permutes created by
+ pattern matching are not. */
+ if (SLP_TREE_REF_COUNT (node) == 1)
+ load_map->remove (node);
+
vect_free_slp_tree (node);
}
}