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

--- Comment #7 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
The backend is returning TImode for get_vectype_for_scalar_type for historical
reasons where large integer modes were considered struct types and this vector
modes.

However they're not modes the vectorizer can use but the backend hook
!targetm.vectorize.get_mask_mode (vecmode).exists (&mask_mode) ICEs because
it's
not a valid vector mode.

I don't think the target hook should ICE, and I don't see how other usages of
the hook do any additional checking.

diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
index 53af5e38b53..b68aea925a4 100644
--- a/gcc/tree-vect-patterns.cc
+++ b/gcc/tree-vect-patterns.cc
@@ -6638,6 +6638,7 @@ vect_recog_cond_store_pattern (vec_info *vinfo,
   machine_mode mask_mode;
   machine_mode vecmode = TYPE_MODE (vectype);
   if (targetm.vectorize.conditional_operation_is_expensive (IFN_MASK_STORE)
+      || !VECTOR_MODE_P (vecmode)
       || !targetm.vectorize.get_mask_mode (vecmode).exists (&mask_mode)
       || !can_vec_mask_load_store_p (vecmode, mask_mode, false))
     return NULL;

This fixes the issue, but I would have expected get_mask_mode to just return
False here.

Reply via email to