Bug 105587 - [13 Regression] ICE in extract_insn, at recog.cc:2791 (error: unrecognizable insn) since r13-210-gfcda0efccad41eba
Summary: [13 Regression] ICE in extract_insn, at recog.cc:2791 (error: unrecognizable ...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 13.0
: P1 normal
Target Milestone: 13.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: yarpgen
  Show dependency treegraph
 
Reported: 2022-05-12 22:44 UTC by Vsevolod Livinskii
Modified: 2022-09-13 19:20 UTC (History)
7 users (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Known to work: 12.0
Known to fail:
Last reconfirmed: 2022-05-13 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Livinskii 2022-05-12 22:44:20 UTC
Link to the Compiler Explorer: https://godbolt.org/z/bboxEaWWx

Reproducer:
extern short arr_108[][4][2][24][12], arr_110[][4][2][24][12];
void test() {
  for (unsigned a = 0; a < 2; a += 2)
    for (unsigned b = 4; b < 22; b++)
      for (int c = 1; c < 11; c++)
        arr_110[0][0][a][b][c] = (unsigned char)arr_108[0][0][a][b][c];
}

Error:
>$ g++ -O3 -c func.cpp   
func.cpp: In function 'void test()':
func.cpp:7:1: error: unrecognizable insn:
    7 | }
      | ^
(insn 18 17 19 2 (set (reg:V1TI 202)
        (ashift:V1TI (subreg:V1TI (reg:V8HI 117 [ vect__15.12 ]) 0)
            (const_int 4294967264 [0xffffffe0]))) "func.cpp":6:70 -1
     (nil))
during RTL pass: vregs
func.cpp:7:1: internal compiler error: in extract_insn, at recog.cc:2791
0x85ea0e _fatal_insn(char const*, rtx_def const*, char const*, int, char const*)
        /testing/gcc/gcc_src_master/gcc/rtl-error.cc:108
0x85ea30 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /testing/gcc/gcc_src_master/gcc/rtl-error.cc:116
0x85cf23 extract_insn(rtx_insn*)
        /testing/gcc/gcc_src_master/gcc/recog.cc:2791
0xecdac5 instantiate_virtual_regs_in_insn
        /testing/gcc/gcc_src_master/gcc/function.cc:1611
0xecdac5 instantiate_virtual_regs
        /testing/gcc/gcc_src_master/gcc/function.cc:1985
0xecdac5 execute
        /testing/gcc/gcc_src_master/gcc/function.cc:2034
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

gcc version 13.0.0 20220512 (7f78783dbedca0183d193e475262ca3c489fd365)
Comment 1 Martin Liška 2022-05-13 06:14:06 UTC
Started with r13-210-gfcda0efccad41eba.
Comment 2 Hongtao.liu 2022-05-13 07:58:53 UTC
Mine, I'm testing a patch.
Comment 3 GCC Commits 2022-05-16 00:30:51 UTC
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:69c4b5c519f0df37e4903992644cc29682721bc1

commit r13-468-g69c4b5c519f0df37e4903992644cc29682721bc1
Author: liuhongt <hongtao.liu@intel.com>
Date:   Fri May 13 15:48:01 2022 +0800

    Fix ICE caused by wrong condition.
    
    When d->perm[i] == d->perm[i-1] + 1 and d->perm[i] == nelt, it's not
    continuous. It should fail if there's more than 2 continuous areas.
    
    gcc/ChangeLog:
    
            PR target/105587
            * config/i386/i386-expand.cc
            (expand_vec_perm_pslldq_psrldq_por): Fail when (d->perm[i] ==
            d->perm[i-1] + 1) && d->perm[i] == nelt && start != -1.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/pr105587.c: New test.
Comment 4 Hongtao.liu 2022-05-16 00:43:32 UTC
Fixed in GCC13.
Comment 5 Sergei Trofimovich 2022-05-18 16:35:31 UTC
Noticed the same ICE on stv-av1-1.0.0. https://gcc.gnu.org/g:69c4b5c519f0df37e4903992644cc29682721bc1 did fix it for me.
Comment 6 Arseny Solokha 2022-09-13 18:50:50 UTC
Should this PR be closed now?
Comment 7 Martin Liška 2022-09-13 19:20:03 UTC
Yes.