+2020-04-27 Felix Yang <felix.yang@huawei.com>
+
+ PR tree-optimization/94784
+ * tree-ssa-forwprop.c (simplify_vector_constructor): Flip the
+ assert around so that it checks that the two vectors have equal
+ TYPE_VECTOR_SUBPARTS and that converting the corresponding element
+ types is a useless_type_conversion_p.
+
2020-04-27 Szabolcs Nagy <szabolcs.nagy@arm.com>
PR target/94515
--- /dev/null
+/* { dg-do compile { target aarch64*-*-* } } */
+/* { dg-options "-O2 -ftree-slp-vectorize -march=armv8.2-a+sve -msve-vector-bits=256" } */
+
+typedef short __attribute__((vector_size (8))) v4hi;
+
+typedef union U4HI { v4hi v; short a[4]; } u4hi;
+
+short a[4];
+
+void pass_v4hi (v4hi v) {
+ int j;
+ u4hi u;
+ u.v = v;
+ for (j = 0; j < 4; j++)
+ a[j] = u.a[j];
+};
tree src_type = TREE_TYPE (orig[0]);
if (!useless_type_conversion_p (type, src_type))
{
- gcc_assert (!targetm.compatible_vector_types_p (type, src_type));
+ gcc_assert (known_eq (TYPE_VECTOR_SUBPARTS (type),
+ TYPE_VECTOR_SUBPARTS (src_type))
+ && useless_type_conversion_p (TREE_TYPE (type),
+ TREE_TYPE (src_type)));
tree rhs = build1 (VIEW_CONVERT_EXPR, type, orig[0]);
orig[0] = make_ssa_name (type);
gassign *assign = gimple_build_assign (orig[0], rhs);
res = gimple_build (&stmts, conv_code, type, res);
else if (!useless_type_conversion_p (type, TREE_TYPE (res)))
{
- gcc_assert (!targetm.compatible_vector_types_p (type, perm_type));
+ gcc_assert (known_eq (TYPE_VECTOR_SUBPARTS (type),
+ TYPE_VECTOR_SUBPARTS (perm_type))
+ && useless_type_conversion_p (TREE_TYPE (type),
+ TREE_TYPE (perm_type)));
res = gimple_build (&stmts, VIEW_CONVERT_EXPR, type, res);
}
/* Blend in the actual constant. */