diff --git a/gcc/internal-fn.cc b/gcc/internal-fn.cc index 71ac483f88ae6686b808857fbd7a43a529f3c3e0..3f1fbc6c91a3bbfc63d2f1f62fb037dd50b9fcd8 100644 --- a/gcc/internal-fn.cc +++ b/gcc/internal-fn.cc @@ -4392,7 +4392,8 @@ vectorized_internal_fn_supported_p (internal_fn ifn, tree type) return direct_internal_fn_supported_p (ifn, type, OPTIMIZE_FOR_SPEED); scalar_mode smode; - if (!is_a <scalar_mode> (TYPE_MODE (type), &smode)) + if (VECTOR_TYPE_P (type) + || !is_a <scalar_mode> (TYPE_MODE (type), &smode)) return false; machine_mode vmode = targetm.vectorize.preferred_simd_mode (smode); diff --git a/gcc/testsuite/gcc.target/i386/pr104496.c b/gcc/testsuite/gcc.target/i386/pr104496.c new file mode 100644 index 0000000000000000000000000000000000000000..62d3bc60281a107448dac0fcb4046bd121cddac0 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr104496.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O -mgeneral-regs-only -msse" } */ + +typedef int __attribute__((__vector_size__ (8))) V; +V a, b; +int c; + +void +foo (void) +{ + b = 0 != a | b << c; +}