public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2
@ 2021-06-10  5:51 zsojka at seznam dot cz
  2021-06-10  6:55 ` [Bug target/101007] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: zsojka at seznam dot cz @ 2021-06-10  5:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101007
           Summary: ICE: in extract_insn, at recog.c:2770 (unrecognizable
                    insn) with -mno-sse2
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 50974
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50974&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mno-sse2 testcase.c
testcase.c: In function 'foo':
testcase.c:10:1: error: unrecognizable insn:
   10 | }
      | ^
(insn 14 7 9 2 (set (reg:V4SI 89)
        (vec_concat:V4SI (mem/c:V2SI (symbol_ref:DI ("v") [flags 0x2] <var_decl
0x7f0b625aeb40 v>) [1 v+0 S8 A128])
            (const_vector:V2SI [
                    (const_int 0 [0]) repeated x2
                ]))) "testcase.c":9:12 -1
     (nil))
during RTL pass: ira
testcase.c:10:1: internal compiler error: in extract_insn, at recog.c:2770
0x71519c _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /repo/gcc-trunk/gcc/rtl-error.c:108
0x71521f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /repo/gcc-trunk/gcc/rtl-error.c:116
0x70394a extract_insn(rtx_insn*)
        /repo/gcc-trunk/gcc/recog.c:2770
0xe75c70 ira_remove_insn_scratches(rtx_insn*, bool, _IO_FILE*, rtx_def*
(*)(rtx_def*))
        /repo/gcc-trunk/gcc/ira.c:5238
0xe789e5 remove_scratches
        /repo/gcc-trunk/gcc/ira.c:5282
0xe789e5 ira
        /repo/gcc-trunk/gcc/ira.c:5606
0xe789e5 execute
        /repo/gcc-trunk/gcc/ira.c:5965
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-1353-20210609220850-gf8b067056ba-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1353-20210609220850-gf8b067056ba-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210610 (experimental) (GCC)

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

* [Bug target/101007] ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2
  2021-06-10  5:51 [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2 zsojka at seznam dot cz
@ 2021-06-10  6:55 ` rguenth at gcc dot gnu.org
  2021-06-10  8:54 ` [Bug target/101007] [12 Regression] " jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-10  6:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-06-10
     Ever confirmed|0                           |1
                 CC|                            |uros at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  It's odd that V4SI seems to be available for permutes (to
veclower),
but then I guess -msse provides some float shuffles.

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

* [Bug target/101007] [12 Regression] ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2
  2021-06-10  5:51 [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2 zsojka at seznam dot cz
  2021-06-10  6:55 ` [Bug target/101007] " rguenth at gcc dot gnu.org
@ 2021-06-10  8:54 ` jakub at gcc dot gnu.org
  2021-06-10  9:47 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-10  8:54 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE: in extract_insn, at    |[12 Regression] ICE: in
                   |recog.c:2770                |extract_insn, at
                   |(unrecognizable insn) with  |recog.c:2770
                   |-mno-sse2                   |(unrecognizable insn) with
                   |                            |-mno-sse2
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |12.0

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ICEs since r12-1128-gef8176e0fac935c095cc39f4ecdfd43cdb8cb3f3 when
__builtin_shufflevector has been introduced.

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

* [Bug target/101007] [12 Regression] ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2
  2021-06-10  5:51 [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2 zsojka at seznam dot cz
  2021-06-10  6:55 ` [Bug target/101007] " rguenth at gcc dot gnu.org
  2021-06-10  8:54 ` [Bug target/101007] [12 Regression] " jakub at gcc dot gnu.org
@ 2021-06-10  9:47 ` jakub at gcc dot gnu.org
  2021-06-10  9:49 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-10  9:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
But it is actually caused by r12-760-g94de7e225c1fda079052c3f0725c926437d56c94

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

* [Bug target/101007] [12 Regression] ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2
  2021-06-10  5:51 [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2 zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2021-06-10  9:47 ` jakub at gcc dot gnu.org
@ 2021-06-10  9:49 ` jakub at gcc dot gnu.org
  2021-06-11 10:59 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-10  9:49 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 50977
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50977&action=edit
gcc12-pr101007.patch

Untested fix.
The *vec_concat<mode>_0 insn the new define_insn_and_split wants to split into
(or *vec_concatv2di_0) have TARGET_SSE2 in condition, while the
define_insn_and_split does not.

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

* [Bug target/101007] [12 Regression] ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2
  2021-06-10  5:51 [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2 zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2021-06-10  9:49 ` jakub at gcc dot gnu.org
@ 2021-06-11 10:59 ` cvs-commit at gcc dot gnu.org
  2021-06-11 12:09 ` jakub at gcc dot gnu.org
  2021-06-15  3:25 ` crazylht at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-11 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r12-1385-ga984da88a35b42f444d1f9eeba77aa520b950d35
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Jun 11 12:58:22 2021 +0200

    i386: Fix up *vec_concat<mode>_0_1 [PR101007]

    On Fri, Apr 23, 2021 at 12:53:58PM +0800, Hongtao Liu via Gcc-patches
wrote:
    > -(define_insn "*vec_concatv4si_0"
    > -  [(set (match_operand:V4SI 0 "register_operand"       "=v,x")
    > -     (vec_concat:V4SI
    > -       (match_operand:V2SI 1 "nonimmediate_operand" "vm,?!*y")
    > -       (match_operand:V2SI 2 "const0_operand"       " C,C")))]
    > +(define_insn "*vec_concat<mode>_0"
    > +  [(set (match_operand:VI124_128 0 "register_operand"       "=v,x")
    > +     (vec_concat:VI124_128
    > +       (match_operand:<ssehalfvecmode> 1 "nonimmediate_operand"
"vm,?!*y")
    > +       (match_operand:<ssehalfvecmode> 2 "const0_operand"       "
C,C")))]
    >    "TARGET_SSE2"
    >    "@
    >     %vmovq\t{%1, %0|%0, %1}
    > @@ -22154,6 +22157,24 @@ (define_insn "avx_vec_concat<mode>"
    >     (set_attr "prefix" "maybe_evex")
    >     (set_attr "mode" "<sseinsnmode>")])
    >
    > +(define_insn_and_split "*vec_concat<mode>_0"
    > +  [(set (match_operand:V 0 "register_operand")
    > +     (vec_select:V
    > +       (vec_concat:<ssedoublevecmode>
    > +         (match_operand:V 1 "nonimmediate_operand")
    > +         (match_operand:V 2 "const0_operand"))
    > +       (match_parallel 3 "movq_parallel"
    > +         [(match_operand 4 "const_int_operand")])))]
    > +  "ix86_pre_reload_split ()"
    > +  "#"
    > +  "&& 1"
    > +  [(set (match_dup 0)
    > +     (vec_concat:V (match_dup 1) (match_dup 5)))]
    > +{
    > +  operands[1] = gen_lowpart (<ssehalfvecmode>mode, operands[1]);
    > +  operands[5] = CONST0_RTX (<ssehalfvecmode>mode);
    > +})

    This regressed the following testcase with -msse -mno-sse2.
    The define_insn_and_split splits the permutation into *vec_concat<mode>_0
    or *vec_concatv2di_0 insns which both have TARGET_SSE2 in their
    conditions (for the former you can see it above), but the
    define_insn_and_split matches always when the V mode's condition do,
    which for V16QI/V8HI/V4SI/V2DI/V4SF modes is always (well, when those
    modes are valid, which is TARGET_SSE).

    2021-06-11  Jakub Jelinek  <jakub@redhat.com>

            PR target/101007
            * config/i386/sse.md (*vec_concat<mode>_0_1): Require TARGET_SSE2.

            * gcc.target/i386/sse-pr101007.c: New test.

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

* [Bug target/101007] [12 Regression] ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2
  2021-06-10  5:51 [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2 zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2021-06-11 10:59 ` cvs-commit at gcc dot gnu.org
@ 2021-06-11 12:09 ` jakub at gcc dot gnu.org
  2021-06-15  3:25 ` crazylht at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-11 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed, although perhaps desirable to backport (except for the testcase).

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

* [Bug target/101007] [12 Regression] ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2
  2021-06-10  5:51 [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2 zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2021-06-11 12:09 ` jakub at gcc dot gnu.org
@ 2021-06-15  3:25 ` crazylht at gmail dot com
  6 siblings, 0 replies; 8+ messages in thread
From: crazylht at gmail dot com @ 2021-06-15  3:25 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao.liu <crazylht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #7 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Jakub Jelinek from comment #6)
> Fixed, although perhaps desirable to backport (except for the testcase).

Since the regression is introduced by
r12-760-g94de7e225c1fda079052c3f0725c926437d56c94, i guess there's no need for
backport unless we want to backport r12-760 too.

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

end of thread, other threads:[~2021-06-15  3:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10  5:51 [Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2 zsojka at seznam dot cz
2021-06-10  6:55 ` [Bug target/101007] " rguenth at gcc dot gnu.org
2021-06-10  8:54 ` [Bug target/101007] [12 Regression] " jakub at gcc dot gnu.org
2021-06-10  9:47 ` jakub at gcc dot gnu.org
2021-06-10  9:49 ` jakub at gcc dot gnu.org
2021-06-11 10:59 ` cvs-commit at gcc dot gnu.org
2021-06-11 12:09 ` jakub at gcc dot gnu.org
2021-06-15  3:25 ` crazylht 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).