https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106322
--- Comment #40 from Kewen Lin <linkw at gcc dot gnu.org> --- > >diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc > >index d666ccccf67..7d8b4ac2200 100644 > >--- a/gcc/internal-fn.cc > >+++ b/gcc/internal-fn.cc > >@@ -3750,7 +3750,12 @@ static bool > > direct_optab_supported_p (direct_optab optab, tree_pair types, > > optimization_type opt_type) > > { > >- machine_mode mode = TYPE_MODE (types.first); > >+ tree type = types.first; > >+ machine_mode mode = TYPE_MODE (type); > >+ /* Scalar mode optab can't work for vector type, return false if > >+ the given type is vector type but the mode isn't vector mode. */ > >+ if (VECTOR_TYPE_P (type) != VECTOR_MODE_P (mode)) > >+ return false; > > There are a few which scalar mode and vector types can differ and still > work: IOR, XOR, and AND. I wonder if those should be special cased here or > somewhere else. Good point! This is overkill then. Not sure if there is this kind of routine to special case them.