https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106942
Bug ID: 106942
Summary: ICE in gen_lowpart_general, at rtlhooks.cc:57, or ICE
in extract_insn, at recog.cc:2791 (error:
unrecognizable insn)
Product: gcc
Version: 13.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
CC: crazylht at gmail dot com, dcb314 at hotmail dot com,
lingling.kong7 at gmail dot com, marxin at gcc dot gnu.org,
unassigned at gcc dot gnu.org
Target Milestone: ---
Target: x86_64-unknown-linux-gnu
+++ This bug was initially created as a clone of Bug #106742 +++
1. gcc 13.0.0 20220911 snapshot (g:0ea5e3f4542832b8da016b152695e64a2a386309)
ICEs when compiling the following testcase, reduced from
gcc/testsuite/gcc.target/i386/vect-bfloat16-2a.c, w/ -mavx -O1:
typedef __bf16 v16bf __attribute__ ((__vector_size__ (32)));
v16bf
vec_init_dup_v16bf (__bf16 a1)
{
return __extension__ (v16bf) {
a1, a1, a1, a1, a1, a1, a1, a1,
a1, a1, a1, a1, a1, a1, a1, a1
};
}
% x86_64-unknown-linux-gnu-gcc-13.0.0 -mavx -O1 -c ohm7ipdh.c
during RTL pass: expand
ohm7ipdh.c: In function 'vec_init_dup_v16bf':
ohm7ipdh.c:6:10: internal compiler error: in gen_lowpart_general, at
rtlhooks.cc:57
6 | return __extension__ (v16bf) {
| ^~~~~~~~~~~~~
0x73101e gen_lowpart_general(machine_mode, rtx_def*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/rtlhooks.cc:57
0x137fbb3 ix86_expand_vector_init_duplicate(bool, machine_mode, rtx_def*,
rtx_def*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/config/i386/i386-expand.cc:15049
0x137f7ff ix86_expand_vector_init_duplicate(bool, machine_mode, rtx_def*,
rtx_def*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/config/i386/i386-expand.cc:15117
0x138377b ix86_expand_vector_init(bool, rtx_def*, rtx_def*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/config/i386/i386-expand.cc:16095
0x1a4f36d ???
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/config/i386/sse.md:26602
0xb30678 rtx_insn* insn_gen_fn::operator()<rtx_def*, rtx_def*>(rtx_def*,
rtx_def*) const
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/recog.h:407
0xb30678 store_constructor(tree_node*, rtx_def*, int, poly_int<1u, long>, bool)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/expr.cc:7407
0xb334dd expand_constructor
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/expr.cc:8745
0xb1fc7a expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/expr.cc:10990
0xb20c36 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/expr.cc:10629
0x9f598c expand_expr
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/expr.h:310
0x9f598c expand_return
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/cfgexpand.cc:3809
0x9f598c expand_gimple_stmt_1
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/cfgexpand.cc:3918
0x9f598c expand_gimple_stmt
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/cfgexpand.cc:4044
0x9fb597 expand_gimple_basic_block
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/cfgexpand.cc:6096
0x9fd137 execute
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/cfgexpand.cc:6822
2. W/ -mavx -O0, it yields the following instead:
% gcc-13.0.0 -mavx -O0 -c ohm7ipdh.c
ohm7ipdh.c: In function 'vec_init_dup_v16bf':
ohm7ipdh.c:10:1: error: unrecognizable insn:
10 | }
| ^
(insn 12 11 13 2 (set (reg:V16BF 84)
(vec_concat:V16BF (reg:V16QI 85)
(reg:V16QI 85))) "ohm7ipdh.c":6:10 -1
(nil))
during RTL pass: vregs
ohm7ipdh.c:10:1: internal compiler error: in extract_insn, at recog.cc:2791
0x730822 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/rtl-error.cc:108
0x73083e _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/rtl-error.cc:116
0x72edc3 extract_insn(rtx_insn*)
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/recog.cc:2791
0xb83be3 instantiate_virtual_regs_in_insn
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/function.cc:1611
0xb83be3 instantiate_virtual_regs
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/function.cc:1985
0xb83be3 execute
/var/tmp/portage/sys-devel/gcc-13.0.0_p20220911/work/gcc-13-20220911/gcc/function.cc:2034
Note the command line lacks -mavx512fp16 in both cases.