]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vect: Fix scalar stmt typo in vect_optimize_slp_pass [PR106886]
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 8 Sep 2022 15:18:28 +0000 (16:18 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 8 Sep 2022 15:18:28 +0000 (16:18 +0100)
Fix a stupid typo in my vect_optimize_slp_pass patch.

gcc/
PR tree-optimization/106886
* tree-vect-slp.cc (vect_optimize_slp_pass::get_result_with_layout):
Fix copying of scalar stmts.

gcc/testsuite/
PR tree-optimization/106886
* gcc.dg/vect/bb-slp-layout-21.c: New test.

gcc/testsuite/gcc.dg/vect/bb-slp-layout-21.c [new file with mode: 0644]
gcc/tree-vect-slp.cc

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-layout-21.c b/gcc/testsuite/gcc.dg/vect/bb-slp-layout-21.c
new file mode 100644 (file)
index 0000000..c851d58
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-march=bdver2" { target x86_64-*-* i?86-*-* } } */
+
+int rl2GeomExport64_little_endian, rl2GeomExport64_little_endian_arch;
+void rl2GeomExport64(unsigned char *p, double value) {
+  union {
+    unsigned char byte[8];
+    double double_value;
+  } convert;
+  convert.double_value = value;
+  if (rl2GeomExport64_little_endian_arch)
+    if (rl2GeomExport64_little_endian) {
+      *(p + 7) = convert.byte[0];
+      *(p + 6) = convert.byte[1];
+      *(p + 5) = convert.byte[2];
+      *(p + 4) = convert.byte[3];
+      *(p + 3) = convert.byte[4];
+      *(p + 2) = convert.byte[5];
+      *(p + 1) = convert.byte[6];
+      *p = convert.byte[7];
+    } else
+      *p = convert.byte[7];
+}
index 3fa2dc96dda6c07f49f19c6e2ca6a1d62248a261..ca3422c2a1e972867f0c7e318edf53c47048ac51 100644 (file)
@@ -5212,7 +5212,7 @@ vect_optimize_slp_pass::get_result_with_layout (slp_tree node,
       if (SLP_TREE_SCALAR_STMTS (node).length ())
        {
          auto &stmts = SLP_TREE_SCALAR_STMTS (result);
-         stmts.safe_splice (SLP_TREE_SCALAR_STMTS (result));
+         stmts.safe_splice (SLP_TREE_SCALAR_STMTS (node));
          if (from_layout_i != 0)
            vect_slp_permute (m_perms[from_layout_i], stmts, false);
          if (to_layout_i != 0)