+2012-11-29 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/53094
+ * fold-const.c (fold): Replace a CONSTRUCTOR with a VECTOR_CST.
+
2012-11-29 Richard Biener <rguenther@suse.de>
* tree-ssa-pre.c (get_expr_value_id): Do not add expr
+2012-11-29 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/53094
+ * cvt.c (ocp_convert): Call convert_to_vector.
+
2012-11-29 Kai Tietz <ktietz@redhat.com>
PR target/53912
conversion. */
else if (TREE_CODE (type) == COMPLEX_TYPE)
return fold_if_not_in_template (convert_to_complex (type, e));
+ else if (TREE_CODE (type) == VECTOR_TYPE)
+ return fold_if_not_in_template (convert_to_vector (type, e));
else if (TREE_CODE (e) == TARGET_EXPR)
{
/* Don't build a NOP_EXPR of class type. Instead, change the
return t;
}
+ /* Return a VECTOR_CST if possible. */
+ case CONSTRUCTOR:
+ {
+ tree type = TREE_TYPE (t);
+ if (TREE_CODE (type) != VECTOR_TYPE)
+ return t;
+
+ tree *vec = XALLOCAVEC (tree, TYPE_VECTOR_SUBPARTS (type));
+ unsigned HOST_WIDE_INT idx, pos = 0;
+ tree value;
+
+ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (t), idx, value)
+ {
+ if (!CONSTANT_CLASS_P (value))
+ return t;
+ if (TREE_CODE (value) == VECTOR_CST)
+ {
+ for (unsigned i = 0; i < VECTOR_CST_NELTS (value); ++i)
+ vec[pos++] = VECTOR_CST_ELT (value, i);
+ }
+ else
+ vec[pos++] = value;
+ }
+ for (; pos < TYPE_VECTOR_SUBPARTS (type); ++pos)
+ vec[pos] = build_zero_cst (TREE_TYPE (type));
+
+ return build_vector (type, vec);
+ }
+
case CONST_DECL:
return fold (DECL_INITIAL (t));
+2012-11-29 Marc Glisse <marc.glisse@inria.fr>
+
+ PR c++/53094
+ * g++.dg/ext/vector20.C: New testcase.
+
2012-11-28 Tobias Burnus <burnus@net-b.de>
PR fortran/52161
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-std=c++11" } */
+
+typedef long vec __attribute__((vector_size (2 * sizeof (long))));
+constexpr vec v = { 3, 4 };
+constexpr vec s = v + v;
+constexpr vec w = __builtin_shuffle (v, v);