public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/94494] New: gcc-10 unrecognizable insn
@ 2020-04-06  6:26 abrahm.scully at gmail dot com
  2020-04-06  6:42 ` [Bug target/94494] " marxin at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: abrahm.scully at gmail dot com @ 2020-04-06  6:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

            Bug ID: 94494
           Summary: gcc-10 unrecognizable insn
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: abrahm.scully at gmail dot com
  Target Milestone: ---

with gcc-10-20200329 built on 32-bit CentOS 6, passing -m32 -march=pentium3
-mfpmath=sse -mstackrealign -O2 -ftree-vectorize -flto ... got the following.

/build/file.cpp:1510:1: error: unrecognizable insn:
 1510 | }
      | ^
(insn 355 354 356 40 (set (reg:V1TI 201)
        (lshiftrt:V1TI (subreg:V1TI (reg:V4SI 89 [ vect_feature_found_41.571 ])
0)
            (const_int 64 [0x40]))) -1
     (nil))
during RTL pass: vregs
/build/file.cpp:1510:1: internal compiler error: in extract_insn, at
recog.c:2294
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

The same code built fine with gcc-9-20200118.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
@ 2020-04-06  6:42 ` marxin at gcc dot gnu.org
  2020-04-10 19:00 ` abrahm.scully at gmail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-06  6:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

Martin Liška <marxin at gcc dot gnu.org> 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 <marxin at gcc dot gnu.org> ---
A test-case will be needed please.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
  2020-04-06  6:42 ` [Bug target/94494] " marxin at gcc dot gnu.org
@ 2020-04-10 19:00 ` abrahm.scully at gmail dot com
  2020-04-10 19:03 ` abrahm.scully at gmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: abrahm.scully at gmail dot com @ 2020-04-10 19:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #2 from Abrahm Scully <abrahm.scully at gmail dot com> ---
Created attachment 48255
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48255&action=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 <https://gcc.gnu.org/bugs/> for instructions.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
  2020-04-06  6:42 ` [Bug target/94494] " marxin at gcc dot gnu.org
  2020-04-10 19:00 ` abrahm.scully at gmail dot com
@ 2020-04-10 19:03 ` abrahm.scully at gmail dot com
  2020-04-10 22:14 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: abrahm.scully at gmail dot com @ 2020-04-10 19:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #3 from Abrahm Scully <abrahm.scully at gmail dot com> ---
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)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
                   ` (2 preceding siblings ...)
  2020-04-10 19:03 ` abrahm.scully at gmail dot com
@ 2020-04-10 22:14 ` ubizjak at gmail dot com
  2020-04-11  0:43 ` abrahm.scully at gmail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2020-04-10 22:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

Uroš Bizjak <ubizjak at gmail dot com> 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 <ubizjak at gmail dot com> ---
Confirmed, fails with -O2 -ftree-vectorize -m32 -msse -mno-sse2.

The compiler generates SSE2 instruction with -msse.

Backtrace:

(gdb) bt
#0  0x0000000001644c80 in gen_sse2_lshrv1ti3(rtx_def*, rtx_def*, rtx_def*) ()
at ./genrtl.h:39
#1  0x00000000013a493f 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 <gen_smaxv4si3(rtx_def*, rtx_def*,
rtx_def*)>, dest=dest@entry=0x7fffea985f00, 
    in=in@entry=0x7fffea97e870) at
/home/uros/git/gcc/gcc/config/i386/i386-expand.c:14977
#3  0x00000000016cec5d in gen_reduc_smax_scal_v4si (operand0=0x7fffea97e600,
operand1=0x7fffea97e870)
    at /home/uros/git/gcc/gcc/config/i386/sse.md:2746
#4  0x0000000000eeb3e9 in maybe_expand_insn (ops=ops@entry=0x7fffffffd860,
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=0x7fffffffd860)
    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_<code>_scal_<mode>"
   [(smaxmin:REDUC_SSE_SMINMAX_MODE
--cut here--

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
                   ` (3 preceding siblings ...)
  2020-04-10 22:14 ` ubizjak at gmail dot com
@ 2020-04-11  0:43 ` abrahm.scully at gmail dot com
  2020-04-11  9:52 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: abrahm.scully at gmail dot com @ 2020-04-11  0:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
                   ` (4 preceding siblings ...)
  2020-04-11  0:43 ` abrahm.scully at gmail dot com
@ 2020-04-11  9:52 ` cvs-commit at gcc dot gnu.org
  2020-04-11 11:23 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-11  9:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

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

commit r10-7687-gf883c46b4877f637e0fa5025b4d6b5c9040ec566
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Sat Apr 11 11:51:41 2020 +0200

    i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

    V4SI, V8HI and V16QI modes of redux_<code>_scal_<mode> 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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
                   ` (5 preceding siblings ...)
  2020-04-11  9:52 ` cvs-commit at gcc dot gnu.org
@ 2020-04-11 11:23 ` cvs-commit at gcc dot gnu.org
  2020-04-11 11:27 ` cvs-commit at gcc dot gnu.org
  2020-04-11 11:29 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-11 11:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

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

commit r9-8491-g59eddd9769057ee094cdae09b15b257cc3db690f
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Sat Apr 11 13:22:52 2020 +0200

    i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

    V4SI, V8HI and V16QI modes of redux_<code>_scal_<mode> 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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
                   ` (6 preceding siblings ...)
  2020-04-11 11:23 ` cvs-commit at gcc dot gnu.org
@ 2020-04-11 11:27 ` cvs-commit at gcc dot gnu.org
  2020-04-11 11:29 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-11 11:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

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

commit r9-8492-gd2fee90546d0f04595301af8f3786b8e1671814a
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Sat Apr 11 13:25:51 2020 +0200

    i386: Fix REDUC_SSE_SMINMAX_MODE mode conditions.

    V4SI, V8HI and V16QI modes of redux_<code>_scal_<mode> 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.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/94494] gcc-10 unrecognizable insn
  2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
                   ` (7 preceding siblings ...)
  2020-04-11 11:27 ` cvs-commit at gcc dot gnu.org
@ 2020-04-11 11:29 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2020-04-11 11:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94494

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed for gcc-9.4+.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-04-11 11:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06  6:26 [Bug target/94494] New: gcc-10 unrecognizable insn abrahm.scully at gmail dot com
2020-04-06  6:42 ` [Bug target/94494] " marxin at gcc dot gnu.org
2020-04-10 19:00 ` abrahm.scully at gmail dot com
2020-04-10 19:03 ` abrahm.scully at gmail dot com
2020-04-10 22:14 ` ubizjak at gmail dot com
2020-04-11  0:43 ` abrahm.scully at gmail dot com
2020-04-11  9:52 ` cvs-commit at gcc dot gnu.org
2020-04-11 11:23 ` cvs-commit at gcc dot gnu.org
2020-04-11 11:27 ` cvs-commit at gcc dot gnu.org
2020-04-11 11:29 ` ubizjak at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).