--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -Wno-psabi -fdump-tree-fre1" } */
+
+#define vector16 __attribute__((vector_size(16)))
+#define vector32 __attribute__((vector_size(32)))
+
+union u1
+{
+ struct s1
+ {
+ vector16 int hi;
+ vector16 int low;
+ }hilow;
+ vector32 int v;
+};
+
+vector16 float f(vector16 int a, vector16 int b)
+{
+ union u1 c;
+ c.hilow.hi = a;
+ c.hilow.low = b;
+ vector32 int d0 = c.v;
+ vector32 float d = (vector32 float)d0;
+ vector16 float e = __builtin_shufflevector (d, d, 0, 1, 2, 3);
+ vector16 float f = __builtin_shufflevector (d, d, 4, 5, 6, 7);
+ return e/f;
+}
+
+/* { dg-final { scan-tree-dump-times "_\[0-9\]\+ = VIEW_CONVERT_EXPR" 2 "fre1" } } */
+/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "fre1" } } */
if (result
&& useless_type_conversion_p (type, TREE_TYPE (result)))
return set_ssa_val_to (lhs, result);
+ else if (result
+ && TYPE_SIZE (type)
+ && TYPE_SIZE (TREE_TYPE (result))
+ && operand_equal_p (TYPE_SIZE (type),
+ TYPE_SIZE (TREE_TYPE (result))))
+ {
+ gimple_match_op match_op (gimple_match_cond::UNCOND,
+ VIEW_CONVERT_EXPR,
+ type, result);
+ result = vn_nary_build_or_lookup (&match_op);
+ if (result)
+ {
+ bool changed = set_ssa_val_to (lhs, result);
+ vn_nary_op_insert_stmt (stmt, result);
+ return changed;
+ }
+ }
}
}
}