public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl @ 2020-10-20 17:52 zsojka at seznam dot cz 2020-10-20 18:45 ` [Bug target/97506] " jakub at gcc dot gnu.org ` (9 more replies) 0 siblings, 10 replies; 11+ messages in thread From: zsojka at seznam dot cz @ 2020-10-20 17:52 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 Bug ID: 97506 Summary: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl Product: gcc Version: 11.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 49410 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49410&action=edit reduced testcase Compiler output: $ x86_64-pc-linux-gnu-gcc -Og -finline-functions-called-once -fno-tree-ccp -mavx512vbmi -mavx512vl testcase.c testcase.c: In function 'foo': testcase.c:15:1: error: unrecognizable insn: 15 | } | ^ (insn 9 8 10 2 (set (reg:V16QI 84 [ _8 ]) (vec_merge:V16QI (const_vector:V16QI [ (const_int 0 [0]) repeated x16 ]) (const_vector:V16QI [ (const_int 0 [0]) repeated x16 ]) (reg:HI 90))) "testcase.c":8:17 -1 (nil)) during RTL pass: vregs testcase.c:15:1: internal compiler error: in extract_insn, at recog.c:2294 0x6ef463 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /repo/gcc-trunk/gcc/rtl-error.c:108 0x6ef4e6 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*) /repo/gcc-trunk/gcc/rtl-error.c:116 0x6de26e extract_insn(rtx_insn*) /repo/gcc-trunk/gcc/recog.c:2294 0xce62b3 instantiate_virtual_regs_in_insn /repo/gcc-trunk/gcc/function.c:1607 0xce62b3 instantiate_virtual_regs /repo/gcc-trunk/gcc/function.c:1977 0xce62b3 execute /repo/gcc-trunk/gcc/function.c:2026 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-r11-4031-20201019090534-g04ffed2ef29-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.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 --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-r11-4031-20201019090534-g04ffed2ef29-checking-yes-rtl-df-extra-amd64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.0.0 20201019 (experimental) (GCC) ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz @ 2020-10-20 18:45 ` jakub at gcc dot gnu.org 2020-10-21 4:40 ` crazylht at gmail dot com ` (8 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu.org @ 2020-10-20 18:45 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2020-10-20 Target Milestone|--- |11.0 Ever confirmed|0 |1 CC| |jakub at gcc dot gnu.org Status|UNCONFIRMED |NEW --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Started with r11-2577-g229752afe3156a3990dacaedb94c76846cebf132 ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz 2020-10-20 18:45 ` [Bug target/97506] " jakub at gcc dot gnu.org @ 2020-10-21 4:40 ` crazylht at gmail dot com 2020-10-21 6:09 ` rguenth at gcc dot gnu.org ` (7 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: crazylht at gmail dot com @ 2020-10-21 4:40 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 Hongtao.liu <crazylht at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |crazylht at gmail dot com --- Comment #2 from Hongtao.liu <crazylht at gmail dot com> --- Could be fixed by diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c index e6f8b314f18..19c12df4401 100644 --- a/gcc/config/i386/i386-expand.c +++ b/gcc/config/i386/i386-expand.c @@ -3525,6 +3525,14 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) machine_mode mode = GET_MODE (dest); machine_mode cmpmode = GET_MODE (cmp); + /* Simplify this trivial compare, avoid ICE error in pr97506. */ + if (rtx_equal_p (op_true, op_false)) + { + emit_move_insn (dest, op_true); + return; + } + /* In AVX512F the result of comparison is an integer mask. */ bool maskcmp = mode != cmpmode && ix86_valid_mask_cmp_mode (mode); But shouldn't middle end also simplify such trivial VCOND_EXPR. _4 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; _6 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; _8 = .VCONDU (_6, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, _4, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 113); ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz 2020-10-20 18:45 ` [Bug target/97506] " jakub at gcc dot gnu.org 2020-10-21 4:40 ` crazylht at gmail dot com @ 2020-10-21 6:09 ` rguenth at gcc dot gnu.org 2020-10-21 7:48 ` jakub at gcc dot gnu.org ` (6 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: rguenth at gcc dot gnu.org @ 2020-10-21 6:09 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Targets shouldn't ICE on unsimplified stuff - the testcase explicitely disables constant propagation so I guess we get what was asked for. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz ` (2 preceding siblings ...) 2020-10-21 6:09 ` rguenth at gcc dot gnu.org @ 2020-10-21 7:48 ` jakub at gcc dot gnu.org 2020-10-21 8:14 ` crazylht at gmail dot com ` (5 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu.org @ 2020-10-21 7:48 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 --- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Yeah. On the other side, they don't need to try hard to optimize it because normally it should be simplified already. So, e.g. the above patch is fine if it works, but it would be also fine to force_reg one of the operands into register, etc. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz ` (3 preceding siblings ...) 2020-10-21 7:48 ` jakub at gcc dot gnu.org @ 2020-10-21 8:14 ` crazylht at gmail dot com 2020-10-21 9:34 ` cvs-commit at gcc dot gnu.org ` (4 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: crazylht at gmail dot com @ 2020-10-21 8:14 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 --- Comment #5 from Hongtao.liu <crazylht at gmail dot com> --- (In reply to Jakub Jelinek from comment #4) > Yeah. On the other side, they don't need to try hard to optimize it because > normally it should be simplified already. So, e.g. the above patch is fine > if it works, but it would be also fine to force_reg one of the operands into > register, etc. Yes, something like, both patches work for this bug. --- @@ -3552,7 +3545,8 @@ ix86_expand_sse_movcc (rtx dest, rtx cmp, rtx op_true, rtx op_false) /* Optimize for mask zero. */ op_true = (op_true != CONST0_RTX (mode) ? force_reg (mode, op_true) : op_true); - op_false = (op_false != CONST0_RTX (mode) + /* Avoid ICE in PR97506 when both op_true and op_false are const0_rtx. */ + op_false = (op_false != CONST0_RTX (mode) || op_true == CONST0_RTX (mode) ? force_reg (mode, op_false) : op_false); if (op_true == CONST0_RTX (mode)) --- ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz ` (4 preceding siblings ...) 2020-10-21 8:14 ` crazylht at gmail dot com @ 2020-10-21 9:34 ` cvs-commit at gcc dot gnu.org 2020-10-21 9:37 ` crazylht at gmail dot com ` (3 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2020-10-21 9:34 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>: https://gcc.gnu.org/g:9b5d50b7c6e34267b40bdeb4c145e9132d83762d commit r11-4184-g9b5d50b7c6e34267b40bdeb4c145e9132d83762d Author: liuhongt <hongtao.liu@intel.com> Date: Wed Oct 21 13:05:16 2020 +0800 Simplify trivial VEC_COND_EXPR in expander. gcc/ChangeLog: PR target/97506 * config/i386/i386-expand.c (ix86_expand_sse_movcc): Move op_true to dest directly when op_true equals op_false. gcc/testsuite/ChangeLog: PR target/97506 * gcc.target/i386/pr97506.c: New test. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz ` (5 preceding siblings ...) 2020-10-21 9:34 ` cvs-commit at gcc dot gnu.org @ 2020-10-21 9:37 ` crazylht at gmail dot com 2020-10-21 9:41 ` jakub at gcc dot gnu.org ` (2 subsequent siblings) 9 siblings, 0 replies; 11+ messages in thread From: crazylht at gmail dot com @ 2020-10-21 9:37 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 --- Comment #7 from Hongtao.liu <crazylht at gmail dot com> --- Should i backport to GCC10? Although it's exposed in GCC11, but it's still a potential bug in GCC10. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz ` (6 preceding siblings ...) 2020-10-21 9:37 ` crazylht at gmail dot com @ 2020-10-21 9:41 ` jakub at gcc dot gnu.org 2020-10-21 9:43 ` cvs-commit at gcc dot gnu.org 2020-11-18 16:49 ` jakub at gcc dot gnu.org 9 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu.org @ 2020-10-21 9:41 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 --- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Yes, looks safe to me. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz ` (7 preceding siblings ...) 2020-10-21 9:41 ` jakub at gcc dot gnu.org @ 2020-10-21 9:43 ` cvs-commit at gcc dot gnu.org 2020-11-18 16:49 ` jakub at gcc dot gnu.org 9 siblings, 0 replies; 11+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2020-10-21 9:43 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 --- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>: https://gcc.gnu.org/g:36ee59a2640712a6e24d9e27290bc5ebbef39709 commit r10-8933-g36ee59a2640712a6e24d9e27290bc5ebbef39709 Author: liuhongt <hongtao.liu@intel.com> Date: Wed Oct 21 13:05:16 2020 +0800 Simplify trivial VEC_COND_EXPR in expander. gcc/ChangeLog: PR target/97506 * config/i386/i386-expand.c (ix86_expand_sse_movcc): Move op_true to dest directly when op_true equals op_false. gcc/testsuite/ChangeLog: PR target/97506 * gcc.target/i386/pr97506.c: New test. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug target/97506] [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz ` (8 preceding siblings ...) 2020-10-21 9:43 ` cvs-commit at gcc dot gnu.org @ 2020-11-18 16:49 ` jakub at gcc dot gnu.org 9 siblings, 0 replies; 11+ messages in thread From: jakub at gcc dot gnu.org @ 2020-11-18 16:49 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97506 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Fixed. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-11-18 16:49 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2020-10-20 17:52 [Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl zsojka at seznam dot cz 2020-10-20 18:45 ` [Bug target/97506] " jakub at gcc dot gnu.org 2020-10-21 4:40 ` crazylht at gmail dot com 2020-10-21 6:09 ` rguenth at gcc dot gnu.org 2020-10-21 7:48 ` jakub at gcc dot gnu.org 2020-10-21 8:14 ` crazylht at gmail dot com 2020-10-21 9:34 ` cvs-commit at gcc dot gnu.org 2020-10-21 9:37 ` crazylht at gmail dot com 2020-10-21 9:41 ` jakub at gcc dot gnu.org 2020-10-21 9:43 ` cvs-commit at gcc dot gnu.org 2020-11-18 16:49 ` jakub at gcc dot gnu.org
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).