re PR target/78227 (ICE: unrecognizable insn: in extract_insn, at recog.c:2311 with...
authorJakub Jelinek <jakub@redhat.com>
Mon, 7 Nov 2016 17:33:27 +0000 (18:33 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 7 Nov 2016 17:33:27 +0000 (18:33 +0100)
PR target/78227
* config/i386/i386.c (ix86_expand_sse_cmp): Force dest into
cmp_mode argument even for -O0 if cmp_mode != mode and maskcmp.

* gcc.target/i386/pr78227-1.c: New test.
* gcc.target/i386/pr78227-2.c: New test.

From-SVN: r241916

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr78227-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr78227-2.c [new file with mode: 0644]

index 1902dbb410794d7d3cd24c07fea6c1d8f1761b71..6bc36e7c634336e417696a54b6d4f57bcb5d25e4 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/78227
+       * config/i386/i386.c (ix86_expand_sse_cmp): Force dest into
+       cmp_mode argument even for -O0 if cmp_mode != mode and maskcmp.
+
 2016-11-07  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
 
        PR middle-end/35691
index a78cf78a201a386465f6f91fba5a991e516b06ec..bbeff1ec94bda1c60b98044bef68c951cbc45a89 100644 (file)
@@ -23561,6 +23561,7 @@ ix86_expand_sse_cmp (rtx dest, enum rtx_code code, rtx cmp_op0, rtx cmp_op1,
     cmp_op1 = force_reg (cmp_ops_mode, cmp_op1);
 
   if (optimize
+      || (maskcmp && cmp_mode != mode)
       || (op_true && reg_overlap_mentioned_p (dest, op_true))
       || (op_false && reg_overlap_mentioned_p (dest, op_false)))
     dest = gen_reg_rtx (maskcmp ? cmp_mode : mode);
index c0efe6d404ac86a6abd14c16f9cc2deb55b3953a..ba56fa6f682e64bf8baa5d65e54aaf012cce1f36 100644 (file)
@@ -1,3 +1,9 @@
+2016-11-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/78227
+       * gcc.target/i386/pr78227-1.c: New test.
+       * gcc.target/i386/pr78227-2.c: New test.
+
 2016-11-07  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
 
        PR middle-end/35691
diff --git a/gcc/testsuite/gcc.target/i386/pr78227-1.c b/gcc/testsuite/gcc.target/i386/pr78227-1.c
new file mode 100644 (file)
index 0000000..9dc97dd
--- /dev/null
@@ -0,0 +1,30 @@
+/* PR target/78227 */
+/* { dg-do compile } */
+/* { dg-options "-mavx512f -O0 -Wno-psabi" } */
+
+typedef int V __attribute__((vector_size (64)));
+typedef long long int W __attribute__((vector_size (64)));
+
+V
+foo1 (V v)
+{
+  return v > 0;
+}
+
+V
+bar1 (V v)
+{
+  return v != 0;
+}
+
+W
+foo2 (W w)
+{
+  return w > 0;
+}
+
+W
+bar2 (W w)
+{
+  return w != 0;
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr78227-2.c b/gcc/testsuite/gcc.target/i386/pr78227-2.c
new file mode 100644 (file)
index 0000000..c557c8f
--- /dev/null
@@ -0,0 +1,30 @@
+/* PR target/78227 */
+/* { dg-do compile } */
+/* { dg-options "-mavx512bw -O0 -Wno-psabi" } */
+
+typedef signed char V __attribute__((vector_size (64)));
+typedef short int W __attribute__((vector_size (64)));
+
+V
+foo1 (V v)
+{
+  return v > 0;
+}
+
+V
+bar1 (V v)
+{
+  return v != 0;
+}
+
+W
+foo2 (W w)
+{
+  return w > 0;
+}
+
+W
+bar2 (W w)
+{
+  return w != 0;
+}