The following fails: $ gcc /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/vshuf-v32hi.c -O1 -mavx5124vnniw -c during GIMPLE pass: fre /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/vshuf-v32hi.c: In function ‘test_27’: /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/vshuf-v32hi.c:12: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1199 0x69c2a8 gen_reg_rtx(machine_mode) /home/marxin/Programming/gcc/gcc/emit-rtl.c:1199 0xafb406 force_reg(machine_mode, rtx_def*) /home/marxin/Programming/gcc/gcc/explow.c:686 0xafb406 force_reg(machine_mode, rtx_def*) /home/marxin/Programming/gcc/gcc/explow.c:666 0x12fe673 ix86_expand_vec_one_operand_perm_avx512 /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:18124 0x12fe673 expand_vec_perm_1 /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:18302 0x12fe820 expand_vec_perm_1 /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:18311 0x13007e8 ix86_expand_vec_perm_const_1 /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:20702 0x1328bb2 ix86_vectorize_vec_perm_const(machine_mode, rtx_def*, rtx_def*, rtx_def*, vec_perm_indices const&) /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:21002 0x14db5ce gimple_simplify_VEC_PERM_EXPR /dev/shm/objdir/gcc/gimple-match.c:154152 0x13405c8 gimple_resimplify3 /home/marxin/Programming/gcc/gcc/gimple-match-head.c:396 0x14dca97 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node* (*)(tree_node*), tree_node* (*)(tree_node*)) /home/marxin/Programming/gcc/gcc/gimple-match-head.c:1002 0xbb0f10 gimple_fold_stmt_to_constant_1(gimple*, tree_node* (*)(tree_node*), tree_node* (*)(tree_node*)) /home/marxin/Programming/gcc/gcc/gimple-fold.c:7330 0x10a1ab5 try_to_simplify /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:5428 0x10a1ab5 visit_stmt /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:5471 0x10a2d86 process_bb /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:7239 0x10a4642 do_rpo_vn /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:7837 0x10a5e5a execute /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:7991 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.
Similarly fails: $ gcc /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/vshuf-v32hi.c -Og -mavx512vp2intersect during GIMPLE pass: fre /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/vshuf-v32hi.c: In function ‘test_27’: /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/vshuf-v32hi.c:12: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1199 0x69c2a8 gen_reg_rtx(machine_mode) /home/marxin/Programming/gcc/gcc/emit-rtl.c:1199 0xafb406 force_reg(machine_mode, rtx_def*) /home/marxin/Programming/gcc/gcc/explow.c:686 0xafb406 force_reg(machine_mode, rtx_def*) /home/marxin/Programming/gcc/gcc/explow.c:666 0x12fe673 ix86_expand_vec_one_operand_perm_avx512 /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:18124 0x12fe673 expand_vec_perm_1 /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:18302 0x12fe820 expand_vec_perm_1 /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:18311 0x13007e8 ix86_expand_vec_perm_const_1 /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:20702 0x1328bb2 ix86_vectorize_vec_perm_const(machine_mode, rtx_def*, rtx_def*, rtx_def*, vec_perm_indices const&) /home/marxin/Programming/gcc/gcc/config/i386/i386-expand.c:21002 0x14db5ce gimple_simplify_VEC_PERM_EXPR /dev/shm/objdir/gcc/gimple-match.c:154152 0x13405c8 gimple_resimplify3 /home/marxin/Programming/gcc/gcc/gimple-match-head.c:396 0x14dca97 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node* (*)(tree_node*), tree_node* (*)(tree_node*)) /home/marxin/Programming/gcc/gcc/gimple-match-head.c:1002 0xbb0f10 gimple_fold_stmt_to_constant_1(gimple*, tree_node* (*)(tree_node*), tree_node* (*)(tree_node*)) /home/marxin/Programming/gcc/gcc/gimple-fold.c:7330 0x10a1ab5 try_to_simplify /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:5428 0x10a1ab5 visit_stmt /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:5471 0x10a2d86 process_bb /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:7239 0x10a4642 do_rpo_vn /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:7837 0x10a5e5a execute /home/marxin/Programming/gcc/gcc/tree-ssa-sccvn.c:7991 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.
I'll have a look.
Created attachment 51286 [details] gcc12-pr101860.patch Untested fix.
*** Bug 101863 has been marked as a duplicate of this bug. ***
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:04b4f3152593f85b05974528d1607619dd77d702 commit r12-2876-g04b4f3152593f85b05974528d1607619dd77d702 Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Aug 12 11:26:57 2021 +0200 i386: Fix up V32HImode permutations with -mno-avx512bw [PR101860] My patch from yesterday apparently broke some V32HImode permutations as the testcase shows. The first function assumed it would never be called in d->testing_p mode and so went right away into emitting the code. And the second one assumed V32HImode would never reach it, which now can for the !TARGET_AVX512BW case. We don't have a instruction in that case though. 2021-08-12 Jakub Jelinek <jakub@redhat.com> PR target/101860 * config/i386/i386-expand.c (ix86_expand_vec_one_operand_perm_avx512): If d->testing_p, return true after performing checks instead of actually expanding the insn. (expand_vec_perm_broadcast_1): Handle V32HImode - assert !TARGET_AVX512BW and return false. * gcc.target/i386/avx512f-pr101860.c: New test.
Fixed.