re PR tree-optimization/91181 (Failing as_as type conversion in vect_build_slp_tree_1)
authorRichard Biener <rguenther@suse.de>
Wed, 17 Jul 2019 07:07:21 +0000 (07:07 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 17 Jul 2019 07:07:21 +0000 (07:07 +0000)
2019-07-17  Richard Biener  <rguenther@suse.de>

PR tree-optimization/91181
* tree-vect-slp.c (vect_build_slp_tree_1): Do not compare
IFN_LOADs as calls.

* gcc.dg/pr91181.c: New testcase.

From-SVN: r273542

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr91181.c [new file with mode: 0644]
gcc/tree-vect-slp.c

index 851f04a8659c40bf40eceae56b6cccdde8e21d21..36ebe6edfaa9625f2078524c3770b212ebe218f3 100644 (file)
@@ -1,3 +1,9 @@
+2019-07-17  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/91181
+       * tree-vect-slp.c (vect_build_slp_tree_1): Do not compare
+       IFN_LOADs as calls.
+
 2019-07-16  Uroš Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (*testdi_1): Match CCZmode for
index 689299b53b78520b5876b93c2c172ff5f40a1367..9cf270f098f11dc754d96fdbb4e7debf0e37b935 100644 (file)
@@ -1,3 +1,8 @@
+2019-07-17  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/91181
+       * gcc.dg/pr91181.c: New testcase.
+
 2019-07-16  Harald Anlauf  <anlauf@gmx.de>
 
        PR fortran/90903
diff --git a/gcc/testsuite/gcc.dg/pr91181.c b/gcc/testsuite/gcc.dg/pr91181.c
new file mode 100644 (file)
index 0000000..63e3362
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-Ofast" } */
+/* { dg-additional-options "-mavx" { target x86_64-*-* i?86-*-* } } */
+
+enum { a, b, c };
+float *d, *e;
+int f, g, h, i;
+int j()
+{
+  float a;
+  for (; h; h++)
+    {
+      i = h * 4;
+      a = d[i + b];
+      if (a) {
+         e[i + b] = g < d[i + b] * f * a ? g : d[i + b] * f * a;
+         e[i + c] = g < d[i + c] * f * a ? g : d[i + c] * f * a;
+      }
+      e[i + b] = e[i + c];
+    }
+}
index 31f4519ff5ae989cbf108482af86a477f46e7c36..0220b1804fb1b00dae7df622d8bf45abb138b1a1 100644 (file)
@@ -857,7 +857,7 @@ vect_build_slp_tree_1 (unsigned char *swap,
              continue;
            }
 
-         if (rhs_code == CALL_EXPR)
+         if (!load_p && rhs_code == CALL_EXPR)
            {
              if (!compatible_calls_p (as_a <gcall *> (stmts[0]->stmt),
                                       as_a <gcall *> (stmt)))