The gcc.dg/vect/vect-simd-clone-20.c testcase ICEs when built with -march=znver4 or -mavx512vl > /spc/abuild/rguenther/gcc14-g/gcc/xgcc -B/spc/abuild/rguenther/gcc14-g/gcc/ /space/rguenther/src/gcc-14-branch/gcc/testsuite/gcc.dg/vect/vect-simd-clone-20.c -mavx512vl --param=vect-partial-vector-usage=0 -fdiagnostics-plain-output -msse2 -ftree-vectorize -fno-tree-loop-distribute-patterns -fno-vect-cost-model -fno-common -O2 -fdump-tree-vect-details -fopenmp-simd --param vect-epilogues-nomask=0 -mavx -lm -o ./vect-simd-clone-20.exe during GIMPLE pass: vect dump file: ./vect-simd-clone-20.c.179t.vect /space/rguenther/src/gcc-14-branch/gcc/testsuite/gcc.dg/vect/vect-simd-clone-20.c: In function ‘masked’: /space/rguenther/src/gcc-14-branch/gcc/testsuite/gcc.dg/vect/vect-simd-clone-20.c:22:1: internal compiler error: tree check: expected vector_type, have integer_type in TYPE_VECTOR_SUBPARTS, at tree.h:4246 0x1b2529a tree_check_failed(tree_node const*, char const*, int, char const*, ...) /space/rguenther/src/gcc-14-branch/gcc/tree.cc:8995 0xd3d83b tree_check(tree_node const*, char const*, int, char const*, tree_code) /space/rguenther/src/gcc-14-branch/gcc/tree.h:3912 0xdcd087 TYPE_VECTOR_SUBPARTS(tree_node const*) /space/rguenther/src/gcc-14-branch/gcc/tree.h:4246 0x305d200 vectorizable_simd_clone_call /space/rguenther/src/gcc-14-branch/gcc/tree-vect-stmts.cc:4719 0x307f49d vect_transform_stmt(vec_info*, _stmt_vec_info*, gimple_stmt_iterator*, _slp_tree*, _slp_instance*) /space/rguenther/src/gcc-14-branch/gcc/tree-vect-stmts.cc:13445 0x1a9c6ba vect_transform_loop_stmt /space/rguenther/src/gcc-14-branch/gcc/tree-vect-loop.cc:11566
This is also in-branch call support. When we build the mask argument for an unconditional branch we have to properly deal with integer mode masks.
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:4f4478f0f31263997bfdc4159f90e58dd79b38f9 commit r15-1990-g4f4478f0f31263997bfdc4159f90e58dd79b38f9 Author: Richard Biener <rguenther@suse.de> Date: Thu Jul 11 10:18:55 2024 +0200 tree-optimization/115867 - ICE with simdcall vectorization in masked loop When only a loop mask is to be supplied for the inbranch arg to a simd function we fail to handle integer mode masks correctly. We need to guess the number of elements represented by it. This assumes that excess arguments are all for masks, I wasn't able to create a simdclone with more than one integer mode mask argument. The gcc.dg/vect/vect-simd-clone-20.c exercises this with -mavx512vl PR tree-optimization/115867 * tree-vect-stmts.cc (vectorizable_simd_clone_call): Properly guess the number of mask elements for integer mode masks.
The releases/gcc-14 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:ca275b68ef11d7d70bff8d7426e45b37366664b3 commit r14-10436-gca275b68ef11d7d70bff8d7426e45b37366664b3 Author: Richard Biener <rguenther@suse.de> Date: Thu Jul 11 10:18:55 2024 +0200 tree-optimization/115867 - ICE with simdcall vectorization in masked loop When only a loop mask is to be supplied for the inbranch arg to a simd function we fail to handle integer mode masks correctly. We need to guess the number of elements represented by it. This assumes that excess arguments are all for masks, I wasn't able to create a simdclone with more than one integer mode mask argument. The gcc.dg/vect/vect-simd-clone-20.c exercises this with -mavx512vl PR tree-optimization/115867 * tree-vect-stmts.cc (vectorizable_simd_clone_call): Properly guess the number of mask elements for integer mode masks. (cherry picked from commit 4f4478f0f31263997bfdc4159f90e58dd79b38f9)
Fixed.