Since vec_duplicate only works on scalar, don't use it on vector in
store constructor expansion.
gcc/
PR middle-end/101294
* expr.c (store_constructor): Don't use vec_duplicate on vector.
gcc/testsuite/
PR middle-end/101294
* gcc.dg/pr101294.c: New test.
&& eltmode == GET_MODE_INNER (mode)
&& ((icode = optab_handler (vec_duplicate_optab, mode))
!= CODE_FOR_nothing)
- && (elt = uniform_vector_p (exp)))
+ && (elt = uniform_vector_p (exp))
+ && !VECTOR_TYPE_P (TREE_TYPE (elt)))
{
class expand_operand ops[2];
create_output_operand (&ops[0], target, mode);
--- /dev/null
+/* PR middle-end/101294 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+/* { dg-additional-options "-mavx" { target avx } } */
+
+typedef __attribute__((__vector_size__ (sizeof (unsigned long long)))) unsigned long long U;
+typedef __attribute__((__vector_size__ (4 * sizeof (unsigned long long)))) unsigned long long V;
+
+extern U x;
+
+void
+foo (void)
+{
+ x = __builtin_shufflevector ((U){}, (V){}, 3);
+}