[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-02-01 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

Jakub Jelinek  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #11 from Jakub Jelinek  ---
ICE is fixed.

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-27 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #10 from Hongtao.liu  ---
Fixed ICE in GCC11, will delete relevant expanders and fold those builtins in
GCC12.

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-27 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #9 from CVS Commits  ---
The master branch has been updated by hongtao Liu :

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

commit r11-6926-g530b1d688761db46b33d26864d3a0684cc82e0f9
Author: liuhongt 
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_gt3): Drop !TARGET_XOP in
condition.
(*sse2_eq3): 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.

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #8 from Hongtao.liu  ---
> For avx2_gt we actually use the expander in one spot, but don't use the
> builtins.

Just note, there're also

modified   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;
 }

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #7 from Jakub Jelinek  ---
If two insns with the same RTL match, then the first one wins.
But the vpcom instructions have different RTL, so I see no reason for the
!TARGET_XOP.
grepping for sse2_eq I see only:
i386-builtin.def:BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_eqv16qi3,
"__builtin_ia32_pcmpeqb128", IX86_BUILTIN_PCMPEQB128, UNKNOWN, (int)
V16QI_FTYPE_V16QI_V16QI)
i386-builtin.def:BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_eqv8hi3,
"__builtin_ia32_pcmpeqw128", IX86_BUILTIN_PCMPEQW128, UNKNOWN, (int)
V8HI_FTYPE_V8HI_V8HI)
i386-builtin.def:BDESC (OPTION_MASK_ISA_SSE2, 0, CODE_FOR_sse2_eqv4si3,
"__builtin_ia32_pcmpeqd128", IX86_BUILTIN_PCMPEQD128, UNKNOWN, (int)
V4SI_FTYPE_V4SI_V4SI )
sse.md:(define_insn "*sse2_eq3"
sse.md:(define_expand "sse2_eq3"
and those 3 builtins are never used in the headers, so we could as well just
remove them and remove the define_expand too (of course keep *sse2_eq with the
!TARGET_XOP dropped).
Also, grepping for avx2_eq I see:
grep avx2_eq *
i386-builtin.def:BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_eqv32qi3,
"__builtin_ia32_pcmpeqb256", IX86_BUILTIN_PCMPEQB256, UNKNOWN, (int)
V32QI_FTYPE_V32QI_V32QI)
i386-builtin.def:BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_eqv16hi3,
"__builtin_ia32_pcmpeqw256", IX86_BUILTIN_PCMPEQW256, UNKNOWN, (int)
V16HI_FTYPE_V16HI_V16HI)
i386-builtin.def:BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_eqv8si3,
"__builtin_ia32_pcmpeqd256", IX86_BUILTIN_PCMPEQD256, UNKNOWN, (int)
V8SI_FTYPE_V8SI_V8SI )
i386-builtin.def:BDESC (OPTION_MASK_ISA_AVX2, 0, CODE_FOR_avx2_eqv4di3,
"__builtin_ia32_pcmpeqq256", IX86_BUILTIN_PCMPEQQ256, UNKNOWN, (int)
V4DI_FTYPE_V4DI_V4DI )
sse.md:(define_expand "avx2_eq3"
sse.md:(define_insn "*avx2_eq3"
sse.md:(define_insn_and_split "*avx2_eq3"
so perhaps again drop the builtins and expander?
Ditto sse2_gt (no expander, rename insn to *sse2_gt and drop builtins).
For avx2_gt we actually use the expander in one spot, but don't use the
builtins.

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #6 from Jakub Jelinek  ---
I think the expander is there to perform ix86_fixup_binary_operands_no_copy
(there is a lot of other expanders that have the sole purpose of doing that).

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #5 from Richard Biener  ---
Or rather keep the define_expand but remove the !TARGET_XOP from the
define_insn?
Will we be confused when we have two define_insns matching?

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #4 from Richard Biener  ---
Eventually XOP has some "better" compares (vpcom).

Btw, why do we have a define_expand for "sse2_eq3"?  Do we use this
as building block internally?  Then we should remove the !TARGET_XOP from
that?  That is, I think

(define_insn "xop_maskcmp3"
  [(set (match_operand:VI_128 0 "register_operand" "=x")
(match_operator:VI_128 1 "ix86_comparison_int_operator"
 [(match_operand:VI_128 2 "register_operand" "x")
  (match_operand:VI_128 3 "nonimmediate_operand" "xm")]))]
  "TARGET_XOP"

should match what that expander generates?

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
So the options are either to restrict the new define_insn_and_split to
!TARGET_XOP, or split into something different when TARGET_XOP.
Seems it is only for the 128-bit comparisons...

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #2 from Hongtao.liu  ---
Oh, becuase xop has it's own integer compare

(define_insn "xop_maskcmp3"
  [(set (match_operand:VI_128 0 "register_operand" "=x")
(match_operator:VI_128 1 "ix86_comparison_int_operator"
 [(match_operand:VI_128 2 "register_operand" "x")
  (match_operand:VI_128 3 "nonimmediate_operand" "xm")]))]
  "TARGET_XOP"
  "vpcom%Y1\t{%3, %2, %0|%0, %2, %3}"
  [(set_attr "type" "sse4arg")
   (set_attr "prefix_data16" "0")
   (set_attr "prefix_rep" "0")
   (set_attr "prefix_extra" "2")
   (set_attr "length_immediate" "1")
   (set_attr "mode" "TI")])

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread crazylht at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

--- Comment #1 from Hongtao.liu  ---
hmm, why TARGET_SSE2 && !TARGET_XOP?

(define_insn "*sse2_eq3"
  [(set (match_operand:VI124_128 0 "register_operand" "=x,x")
(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
   && !(MEM_P (operands[1]) && MEM_P (operands[2]))"

[Bug target/98833] [11 Regression] ICE in extract_insn, at recog.c:2769 since r11-6849-gee78c20e74d30284

2021-01-26 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98833

Martin Liška  changed:

   What|Removed |Added

  Known to work||10.2.0
   Priority|P3  |P1
 Ever confirmed|0   |1
   Target Milestone|--- |11.0
  Known to fail||11.0
   Last reconfirmed||2021-01-26
 Status|UNCONFIRMED |NEW