Fix ICE for [PR target/98833].
authorliuhongt <hongtao.liu@intel.com>
Wed, 27 Jan 2021 05:22:36 +0000 (13:22 +0800)
committerliuhongt <hongtao.liu@intel.com>
Wed, 27 Jan 2021 10:49:25 +0000 (18:49 +0800)
And replace __builtin_ia32_pcmpeqb128 with operator == in libcpp.

gcc/ChangeLog:

PR target/98833
* config/i386/sse.md (sse2_gt<mode>3): Drop !TARGET_XOP in condition.
(*sse2_eq<mode>3): Ditto.

gcc/testsuite/ChangeLog:

PR target/98833
* gcc.target/i386/pr98833.c: New test.

libcpp/

PR target/98833
* lex.c (search_line_sse2): Replace builtins with == operator.

gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/pr98833.c [new file with mode: 0644]
libcpp/lex.c

index 9683a991fb2f716460a8c4ec43f441b8de263192..369a00d8f51d110a9668c83cc5fc8263b3f02225 100644 (file)
        (eq:VI124_128
          (match_operand:VI124_128 1 "vector_operand" "%0,x")
          (match_operand:VI124_128 2 "vector_operand" "xBm,xm")))]
-  "TARGET_SSE2 && !TARGET_XOP
+  "TARGET_SSE2
    && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
   "@
    pcmpeq<ssemodesuffix>\t{%2, %0|%0, %2}
        (gt:VI124_128
          (match_operand:VI124_128 1 "register_operand" "0,x")
          (match_operand:VI124_128 2 "vector_operand" "xBm,xm")))]
-  "TARGET_SSE2 && !TARGET_XOP"
+  "TARGET_SSE2"
   "@
    pcmpgt<ssemodesuffix>\t{%2, %0|%0, %2}
    vpcmpgt<ssemodesuffix>\t{%2, %1, %0|%0, %1, %2}"
diff --git a/gcc/testsuite/gcc.target/i386/pr98833.c b/gcc/testsuite/gcc.target/i386/pr98833.c
new file mode 100644 (file)
index 0000000..086c37c
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR target/98833  */
+/* { dg-do compile } */
+/* { dg-options "-mavx512vl -O2 -mxop" } */
+
+int __attribute__((__vector_size__(4 * sizeof(int)))) * f5_p;
+int __attribute__((__vector_size__(4 * sizeof(int)))) * f6_p;
+
+void f5() { *f5_p = 0 == *f5_p; }
+void f6() { *f5_p = *f6_p > *f5_p; }
index cba0b6c1e1b6c71ad46d9a22259df1ed6cb25067..6af140459addbce90f960efbe87099412d083582 100644 (file)
@@ -391,10 +391,10 @@ search_line_sse2 (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
       mask = -1;
 
     start:
-      t  = __builtin_ia32_pcmpeqb128(data, repl_nl);
-      t |= __builtin_ia32_pcmpeqb128(data, repl_cr);
-      t |= __builtin_ia32_pcmpeqb128(data, repl_bs);
-      t |= __builtin_ia32_pcmpeqb128(data, repl_qm);
+      t  = data == repl_nl;
+      t |= data == repl_cr;
+      t |= data == repl_bs;
+      t |= data == repl_qm;
       found = __builtin_ia32_pmovmskb128 (t);
       found &= mask;
     }