https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122762

--- Comment #18 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #13)
> I can reproduce a similar (ASLR dependent) issue with
> 
> make check-gcc
> RUNTESTFLAGS="--target_board=unix/-march=znver4/--param=vect-partial-vector-
> usage=2 vect.exp=vect-simd-clone-20.c"
> 
> on x86_64:
> 
> /space/rguenther/src/gcc-autopar_devel/gcc/testsuite/gcc.dg/vect/vect-simd-
> clone-20.c:24:1: internal compiler error: tree check: expected vector_type,
> have integer_type in TYPE_VECTOR_SUBPARTS, at tree.h:4368
> 0x37e157b internal_error(char const*, ...)
>        
> /space/rguenther/src/gcc-autopar_devel/gcc/diagnostic-global-context.cc:787
> 0x1e96386 tree_check_failed(tree_node const*, char const*, int, char const*,
> ...)
>         /space/rguenther/src/gcc-autopar_devel/gcc/tree.cc:9189
> 0xf74d9f tree_check(tree_node const*, char const*, int, char const*,
> tree_code)
>         /space/rguenther/src/gcc-autopar_devel/gcc/tree.h:4034
> 0x101780b TYPE_VECTOR_SUBPARTS(tree_node const*)
>         /space/rguenther/src/gcc-autopar_devel/gcc/tree.h:4368
> 0x1e00e83 vect_get_loop_mask(_loop_vec_info*, gimple_stmt_iterator*,
> vec_loop_masks*, unsigned int, tree_node*, unsigned int)
>         /space/rguenther/src/gcc-autopar_devel/gcc/tree-vect-loop.cc:10590
> 0x1daec1d vectorizable_simd_clone_call
>         /space/rguenther/src/gcc-autopar_devel/gcc/tree-vect-stmts.cc:4887

so here we have a simdclone with 'unsigned int' vector_type for its
SIMD_CLONE_ARG_TYPE_MASK.  That's unexpected.

One issue is that we do not inspect all simdclone args when not wrapped
in a .MASK_CALL, but for loop masking we'd still need to do that.  The
logic also seems to expect a 1:1 relationship between scalar call number
of args and simdclone number of args (not allowing for larger simdlen
with multiple args for an original scalar arg).

I wonder whether it's worth special-casing that we are going to always
be able to code generate the all-true mask when masking is not necessary
but we chose an in-branch simdclone.  Otherwise we could selectively
disable loop masking when the ARG_TYPE_MASK vectype isn't a vector type.

Reply via email to