On 09/21/2012 02:32 PM, Marc Glisse wrote:
+ gcc_assert (TREE_CODE (type0) == VECTOR_TYPE
+ || TREE_CODE (type1) == VECTOR_TYPE);
+ switch (code)
+ {
+ case RSHIFT_EXPR:
+ case LSHIFT_EXPR:
+ if (TREE_CODE (type0) == INTEGER_TYPE
+ && TREE_CODE (TREE_TYPE (type1)) == INTEGER_TYPE)
Here you're asserting that one of the types is a vector and then
assuming that type1 is a vector and type0 is not. I guess you need to
move the swapping code out of the switch.
+ error_at (loc, "conversion of scalar to vector "
+ "involves truncation");
These errors should print the types involved. They also need to be
suppressed when !(complain & tf_error).
+ op0 = convert (TREE_TYPE (type1), op0);
+ op0 = build_vector_from_val (type1, op0);
I don't see anything in cp_build_binary_op that makes sure that the
VECTOR_TYPE is in type1.
Jason