public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Sandiford <rsandifo@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-2544] vect: Fix scalar stmt typo in vect_optimize_slp_pass [PR106886]
Date: Thu,  8 Sep 2022 15:18:42 +0000 (GMT)	[thread overview]
Message-ID: <20220908151842.52A693858421@sourceware.org> (raw)

https://gcc.gnu.org/g:338a5b0d7da84ef1f6c01dd96abf2c6bc830f403

commit r13-2544-g338a5b0d7da84ef1f6c01dd96abf2c6bc830f403
Author: Richard Sandiford <richard.sandiford@arm.com>
Date:   Thu Sep 8 16:18:28 2022 +0100

    vect: Fix scalar stmt typo in vect_optimize_slp_pass [PR106886]
    
    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.

Diff:
---
 gcc/testsuite/gcc.dg/vect/bb-slp-layout-21.c | 23 +++++++++++++++++++++++
 gcc/tree-vect-slp.cc                         |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)

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
index 00000000000..c851d58c97a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-layout-21.c
@@ -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];
+}
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 3fa2dc96dda..ca3422c2a1e 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -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)

                 reply	other threads:[~2022-09-08 15:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220908151842.52A693858421@sourceware.org \
    --to=rsandifo@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).