+2019-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/89210
+ * fold-const-call.c (fold_const_vec_convert): Pass true as last
+ operand to new_unary_operation only if both element types are integral
+ and it isn't a widening conversion. Return NULL_TREE if
+ new_unary_operation failed.
+
2019-02-05 Andreas Krebbel <krebbel@linux.ibm.com>
PR target/88856
&& SCALAR_FLOAT_TYPE_P (TREE_TYPE (ret_type)))
code = FLOAT_EXPR;
+ /* We can't handle steps directly when extending, since the
+ values need to wrap at the original precision first. */
+ bool step_ok_p
+ = (INTEGRAL_TYPE_P (TREE_TYPE (ret_type))
+ && INTEGRAL_TYPE_P (TREE_TYPE (arg_type))
+ && (TYPE_PRECISION (TREE_TYPE (ret_type))
+ <= TYPE_PRECISION (TREE_TYPE (arg_type))));
tree_vector_builder elts;
- elts.new_unary_operation (ret_type, arg, true);
+ if (!elts.new_unary_operation (ret_type, arg, step_ok_p))
+ return NULL_TREE;
+
unsigned int count = elts.encoded_nelts ();
for (unsigned int i = 0; i < count; ++i)
{
+2019-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/89210
+ * c-c++-common/builtin-convertvector-2.c: New test.
+
2019-02-05 Nikhil Benesch <nikhil.benesch@gmail.com>
PR go/89019
--- /dev/null
+/* PR middle-end/89210 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+typedef int v4si __attribute__((vector_size (4 * sizeof (int))));
+typedef double v4df __attribute__((vector_size (4 * sizeof (double))));
+void
+foo (v4df *x)
+{
+ v4si a = { 1, 2, 3, 4 };
+ *x = __builtin_convertvector (a, v4df);
+}