https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111048
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rsandifo at gcc dot gnu.org
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
We somehow compute res_nelts to 12, coming via
/* (1) If SEL is a suitable mask as determined by
valid_mask_for_fold_vec_perm_cst_p, then:
res_npatterns = max of npatterns between ARG0, ARG1, and SEL
res_nelts_per_pattern = max of nelts_per_pattern between
ARG0, ARG1 and SEL.
(2) If SEL is not a suitable mask, and TYPE is VLS then:
res_npatterns = nelts in result vector.
res_nelts_per_pattern = 1.
This exception is made so that VLS ARG0, ARG1 and SEL work as before. */
if (valid_mask_for_fold_vec_perm_cst_p (arg0, arg1, sel, reason))
{
I suppose doing
else if (TYPE_VECTOR_SUBPARTS (type).is_constant (&res_nelts))
first would fix this, but then the above looks wrong?
I'm going to test & push the "obvious" to fix x86_64, but I suppose you should
double-check your logic that goes wrong for non-VLA vectors.