[gcc r11-6926] Fix ICE for [PR target/98833].

hongtao Liu liuhongt@gcc.gnu.org
Wed Jan 27 10:49:41 GMT 2021


https://gcc.gnu.org/g:530b1d688761db46b33d26864d3a0684cc82e0f9

commit r11-6926-g530b1d688761db46b33d26864d3a0684cc82e0f9
Author: liuhongt <hongtao.liu@intel.com>
Date:   Wed Jan 27 13:22:36 2021 +0800

    Fix ICE for [PR target/98833].
    
    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.

Diff:
---
 gcc/config/i386/sse.md                  | 4 ++--
 gcc/testsuite/gcc.target/i386/pr98833.c | 9 +++++++++
 libcpp/lex.c                            | 8 ++++----
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 9683a991fb2..369a00d8f51 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -13041,7 +13041,7 @@
 	(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}
@@ -13143,7 +13143,7 @@
 	(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
index 00000000000..086c37cad55
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr98833.c
@@ -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; }
diff --git a/libcpp/lex.c b/libcpp/lex.c
index cba0b6c1e1b..6af140459ad 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -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;
     }


More information about the Gcc-cvs mailing list