[Bug target/94494] gcc-10 unrecognizable insn

2020-04-11 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

Uroš Bizjak  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #9 from Uroš Bizjak  ---
Fixed for gcc-9.4+.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-11 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #8 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Uros Bizjak :

https://gcc.gnu.org/g:d2fee90546d0f04595301af8f3786b8e1671814a

commit r9-8492-gd2fee90546d0f04595301af8f3786b8e1671814a
Author: Uros Bizjak 
Date:   Sat Apr 11 13:25:51 2020 +0200

i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

V4SI, V8HI and V16QI modes of redux__scal_ expander
expand with SSE2 instructions (PSRLDQ and PCMPGTx) so use
TARGET_SSE2 as relevant mode iterator codition.

PR target/94494
* config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE2
condition for V4SI, V8HI and V16QI modes.

testsuite/ChangeLog:

PR target/94494
* gcc.target/i386/pr94494.c: New test.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-11 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #7 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Uros Bizjak :

https://gcc.gnu.org/g:59eddd9769057ee094cdae09b15b257cc3db690f

commit r9-8491-g59eddd9769057ee094cdae09b15b257cc3db690f
Author: Uros Bizjak 
Date:   Sat Apr 11 13:22:52 2020 +0200

i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

V4SI, V8HI and V16QI modes of redux__scal_ expander
expand with SSE2 instructions (PSRLDQ and PCMPGTx) so use
TARGET_SSE2 as relevant mode iterator codition.

PR target/94494
* config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE2
condition for V4SI, V8HI and V16QI modes.

testsuite/ChangeLog:

PR target/94494
* gcc.target/i386/pr94494.c: New test.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-11 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Uros Bizjak :

https://gcc.gnu.org/g:f883c46b4877f637e0fa5025b4d6b5c9040ec566

commit r10-7687-gf883c46b4877f637e0fa5025b4d6b5c9040ec566
Author: Uros Bizjak 
Date:   Sat Apr 11 11:51:41 2020 +0200

i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

V4SI, V8HI and V16QI modes of redux__scal_ expander
expand with SSE2 instructions (PSRLDQ and PCMPGTx) so use
TARGET_SSE2 as relevant mode iterator codition.

PR target/94494
* config/i386/sse.md (REDUC_SSE_SMINMAX_MODE): Use TARGET_SSE2
condition for V4SI, V8HI and V16QI modes.

testsuite/ChangeLog:

PR target/94494
* gcc.target/i386/pr94494.c: New test.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-10 Thread abrahm.scully at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #5 from Abrahm Scully  ---
I can't comment on the patch's correctness, but applied to gcc-10-20200405 it
does prevent the "unrecognizable insn" error.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-10 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

Uroš Bizjak  changed:

   What|Removed |Added

 Status|WAITING |ASSIGNED
   Target Milestone|--- |9.4
   Assignee|unassigned at gcc dot gnu.org  |ubizjak at gmail dot com

--- Comment #4 from Uroš Bizjak  ---
Confirmed, fails with -O2 -ftree-vectorize -m32 -msse -mno-sse2.

The compiler generates SSE2 instruction with -msse.

Backtrace:

(gdb) bt
#0  0x01644c80 in gen_sse2_lshrv1ti3(rtx_def*, rtx_def*, rtx_def*) ()
at ./genrtl.h:39
#1  0x013a493f in emit_reduc_half (i=128, src=0x7fffea97e870,
dest=0x7fffea985f18)
at /home/uros/git/gcc/gcc/config/i386/i386-expand.c:14870
#2  ix86_expand_reduc (fn=fn@entry=0x160ac80 , dest=dest@entry=0x7fffea985f00, 
in=in@entry=0x7fffea97e870) at
/home/uros/git/gcc/gcc/config/i386/i386-expand.c:14977
#3  0x016cec5d in gen_reduc_smax_scal_v4si (operand0=0x7fffea97e600,
operand1=0x7fffea97e870)
at /home/uros/git/gcc/gcc/config/i386/sse.md:2746
#4  0x00eeb3e9 in maybe_expand_insn (ops=ops@entry=0x7fffd860,
nops=nops@entry=2, 
icode=icode@entry=CODE_FOR_reduc_smax_scal_v4si) at
/home/uros/git/gcc/gcc/optabs.c:7508
#5  expand_insn (icode=icode@entry=CODE_FOR_reduc_smax_scal_v4si,
nops=nops@entry=2, ops=ops@entry=0x7fffd860)
at /home/uros/git/gcc/gcc/optabs.c:7508

REDUC_SSE_SMINMAX_MODE mode iterator allows V4SI, V8HI and V16QI modes for SSE,
but we have:

case E_V16QImode:
case E_V8HImode:
case E_V4SImode:
case E_V2DImode:
  d = gen_reg_rtx (V1TImode);
  tem = gen_sse2_lshrv1ti3 (d, gen_lowpart (V1TImode, src),
GEN_INT (i / 2));
  break;

in i386-expand.c/emit_reduc_half.

Patch in testing:

--cut here--
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 8f5902292c6..d978e2aa256 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -2733,8 +2733,8 @@
 ;; Modes handled by reduc_sm{in,ax}* patterns.
 (define_mode_iterator REDUC_SSE_SMINMAX_MODE
   [(V4SF "TARGET_SSE") (V2DF "TARGET_SSE")
-   (V2DI "TARGET_SSE4_2") (V4SI "TARGET_SSE") (V8HI "TARGET_SSE")
-   (V16QI "TARGET_SSE")])
+   (V4SI "TARGET_SSE2") (V8HI "TARGET_SSE2") (V16QI "TARGET_SSE2")
+   (V2DI "TARGET_SSE4_2")])

 (define_expand "reduc__scal_"
   [(smaxmin:REDUC_SSE_SMINMAX_MODE
--cut here--

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-10 Thread abrahm.scully at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #3 from Abrahm Scully  ---
Not sure if this is helpful, but "gcc -v" outputs:
Reading specs from /opt/tools-20200401/lib/gcc/i686-pc-linux-gnu/10/specs
COLLECT_GCC=/opt/tools-20200401/bin/gcc
COLLECT_LTO_WRAPPER=/opt/tools-20200401/libexec/gcc/i686-pc-linux-gnu/10/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/opt/tools-20200401 --with-system-zlib
--enable-languages=c,c++,fortran,lto --enable-bootstrap --enable-libgomp
--enable-checking=release --enable-shared --enable-threads=posix
--with-arch=pentium3 --with-tune=pentium3 --disable-multilib
--enable-initfini-array --enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --with-zstd --disable-libssp --enable-__cxa_atexit
--disable-libunwind-exceptions --with-gcc-major-version-only --with-isl
-disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.1 20200329 (experimental) (GCC)

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-10 Thread abrahm.scully at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #2 from Abrahm Scully  ---
Created attachment 48255
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48255=edit
preprocessed source file

With gcc-10-20200329, "g++ -Wall -ftree-vectorize -march=pentium3 -O2 -m32 -c
illegal-insn.cpp.ii -o illegal-insn.cpp.o" prints the following:

illegal-insn.cpp: In function 'void illegal_insn(float*, float*, float*, int,
int, int, int, int)':
illegal-insn.cpp:16:1: error: unrecognizable insn:
   16 | }
  | ^
(insn 80 79 81 13 (set (reg:V1TI 144)
(lshiftrt:V1TI (subreg:V1TI (reg:V4SI 113 [ vect_found_18.20 ]) 0)
(const_int 64 [0x40]))) -1
 (nil))
during RTL pass: vregs
illegal-insn.cpp:16:1: internal compiler error: in extract_insn, at
recog.c:2294
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

[Bug target/94494] gcc-10 unrecognizable insn

2020-04-06 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

Martin Liška  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |WAITING
 CC||marxin at gcc dot gnu.org
   Last reconfirmed||2020-04-06

--- Comment #1 from Martin Liška  ---
A test-case will be needed please.