re PR tree-optimization/71655 (GCC trunk ICE on westmere target)
authorIlya Enkovich <ilya.enkovich@intel.com>
Wed, 29 Jun 2016 12:26:40 +0000 (12:26 +0000)
committerIlya Enkovich <ienkovich@gcc.gnu.org>
Wed, 29 Jun 2016 12:26:40 +0000 (12:26 +0000)
gcc/

PR tree-optimization/71655
* tree-vect-stmts.c (vectorizable_comparison): Swap definition
types when swapping operands.

gcc/testsuite/

PR tree-optimization/71655
* g++.dg/pr71655.C: New test.

From-SVN: r237846

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr71655.C [new file with mode: 0644]
gcc/tree-vect-stmts.c

index 1c63e41f51559baa3784a3ece7ac04fe14dcb752..3900362650a767c4a862ec9aba8e78fa1551c268 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-29  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR tree-optimization/71655
+       * tree-vect-stmts.c (vectorizable_comparison): Swap definition
+       types when swapping operands.
+
 2016-06-29  Martin Liska  <mliska@suse.cz>
 
        PR middle-end/71585
index 6e132a25448bd6cef205130574a0e42667e8a824..6801c5fb90621889854b9d39e6ce39e4dfb2a645 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-29  Ilya Enkovich  <ilya.enkovich@intel.com>
+
+       PR tree-optimization/71655
+       * g++.dg/pr71655.C: New test.
+
 2016-06-29  Martin Liska  <mliska@suse.cz>
 
        * gcc.dg/pr71585.c: New test.
diff --git a/gcc/testsuite/g++.dg/pr71655.C b/gcc/testsuite/g++.dg/pr71655.C
new file mode 100644 (file)
index 0000000..8ed3371
--- /dev/null
@@ -0,0 +1,28 @@
+// PR tree-optimization/71655
+// { dg-do compile }
+// { dg-options "-O3 -std=c++11" }
+// { dg-additional-options "-msse4" { target i?86-*-* x86_64-*-* } }
+
+#include <functional>
+#include <valarray>
+extern int var_16, le_s5, le_s6, le_s9;
+std::array<std::array<std::array<long, 8>, 4>, 24> v4;
+extern std::array<std::array<int, 48>, 18> v15;
+
+void fn1() {
+  for (int k0 = 0;;)
+    for (int i1 = 0;;)
+      for (int j1 = 0; j1 < le_s9; j1 = j1 + 1) {
+       std::valarray<std::valarray<short>> v15_;
+        for (; le_s5;) {
+         std::array<std::array<std::array<int, 3>, 48>, 18> v16;
+          for (int k2 = 0;; k2 = 1)
+            for (int l2 = 2; l2 < 6; l2 = l2 + 1)
+              for (int k3 = 0; le_s6;)
+                for (int i4 = 0; i4 < le_s9; i4 = i4 + 1)
+                  *(i4 + (*v16.begin())[k3].begin()) =
+                   (v15[k2][l2] || var_16) >
+                   unsigned(i1 <= (*v4.begin()).at(k0).at(j1));
+        }
+      }
+}
index 5c655029dd59a582a205157b315cc5eccf8beca1..c41550d4a1b403bd63150392dc2239b62e15aa61 100644 (file)
@@ -7858,12 +7858,14 @@ vectorizable_comparison (gimple *stmt, gimple_stmt_iterator *gsi,
          bitop1 = BIT_NOT_EXPR;
          bitop2 = BIT_AND_EXPR;
          std::swap (rhs1, rhs2);
+         std::swap (dts[0], dts[1]);
        }
       else if (code == LE_EXPR)
        {
          bitop1 = BIT_NOT_EXPR;
          bitop2 = BIT_IOR_EXPR;
          std::swap (rhs1, rhs2);
+         std::swap (dts[0], dts[1]);
        }
       else
        {