===================================================================
@@ -913,21 +913,23 @@ convert_to_integer (tree type, tree expr
return build1 (FIXED_CONVERT_EXPR, type, expr);
case COMPLEX_TYPE:
return convert (type,
fold_build1 (REALPART_EXPR,
TREE_TYPE (TREE_TYPE (expr)), expr));
case VECTOR_TYPE:
if (!tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (expr))))
{
- error ("can%'t convert between vector values of different size");
+ error ("can%'t convert a vector of type %qT"
+ " to type %qT which has different size",
+ TREE_TYPE (expr), type);
return error_mark_node;
}
return build1 (VIEW_CONVERT_EXPR, type, expr);
default:
error ("aggregate value used where an integer was expected");
return convert (type, integer_zero_node);
}
}
@@ -997,21 +999,23 @@ convert_to_complex (tree type, tree expr
tree
convert_to_vector (tree type, tree expr)
{
switch (TREE_CODE (TREE_TYPE (expr)))
{
case INTEGER_TYPE:
case VECTOR_TYPE:
if (!tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (expr))))
{
- error ("can%'t convert between vector values of different size");
+ error ("can%'t convert a value of type %qT"
+ " to vector type %qT which has different size",
+ TREE_TYPE (expr), type);
return error_mark_node;
}
return build1 (VIEW_CONVERT_EXPR, type, expr);
default:
error ("can%'t convert value to a vector");
return error_mark_node;
}
}
===================================================================
@@ -38,21 +38,21 @@ hanneke ()
/* Casted different signed SIMD assignment. */
f = (uv4si) a;
/* Assignment between scalar and SIMD of different size. */
foo = a; /* { dg-error "incompatible types when assigning" } */
/* Casted assignment between scalar and SIMD of same size. */
foo = (typeof (foo)) foo2;
/* Casted assignment between scalar and SIMD of different size. */
- foo1 = (typeof (foo1)) foo2; /* { dg-error "can't convert between vector values of different size" } */
+ foo1 = (typeof (foo1)) foo2; /* { dg-error "can't convert a vector of type" } */
/* Operators on compatible SIMD types. */
a += b + b;
a -= b;
a *= b;
a /= b;
a = -b;
/* Operators on incompatible SIMD types. */
a = b + c; /* { dg-error "invalid operands to binary +" } */