===================================================================
@@ -2833,20 +2833,22 @@ simplify_vector_constructor (gimple_stmt
ref = TREE_OPERAND (op1, 0);
if (orig)
{
if (ref != orig)
return false;
}
else
{
if (TREE_CODE (ref) != SSA_NAME)
return false;
+ if (TREE_TYPE (ref) != type)
+ return false;
orig = ref;
}
if (TREE_INT_CST_LOW (TREE_OPERAND (op1, 1)) != elem_size)
return false;
sel[i] = TREE_INT_CST_LOW (TREE_OPERAND (op1, 2)) / elem_size;
if (sel[i] != i) maybe_ident = false;
}
if (i < nelts)
return false;
===================================================================
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef double v2df __attribute__ ((__vector_size__ (16)));
+typedef double v4df __attribute__ ((__vector_size__ (32)));
+
+void f (v2df *ret, v4df* xp)
+{
+ v4df x = *xp;
+ v2df xx = { x[2], x[3] };
+ *ret = xx;
+}