===================================================================
@@ -4448,22 +4448,22 @@ build_conditional_expr_1 (tree arg1, tre
|| TYPE_SIZE (arg1_type) != TYPE_SIZE (arg2_type))
{
if (complain & tf_error)
error ("incompatible vector types in conditional expression: "
"%qT, %qT and %qT", TREE_TYPE (arg1), TREE_TYPE (orig_arg2),
TREE_TYPE (orig_arg3));
return error_mark_node;
}
if (!COMPARISON_CLASS_P (arg1))
- arg1 = fold_build2 (NE_EXPR, signed_type_for (arg1_type), arg1,
- build_zero_cst (arg1_type));
+ arg1 = cp_build_binary_op (input_location, NE_EXPR, arg1,
+ build_zero_cst (arg1_type), complain);
return fold_build3 (VEC_COND_EXPR, arg2_type, arg1, arg2, arg3);
}
/* [expr.cond]
The first expression is implicitly converted to bool (clause
_conv_). */
arg1 = perform_implicit_conversion_flags (boolean_type_node, arg1, complain,
LOOKUP_NORMAL);
if (error_operand_p (arg1))
===================================================================
@@ -4,19 +4,19 @@
typedef unsigned vec __attribute__((vector_size(4*sizeof(int))));
/* Disabled after PR57286
void f(vec*a,vec*b){
*a=(*a)?-1:(*b<10);
*b=(*b)?(*a<10):0;
}
*/
void g(vec*a,vec*b){
*a=(*a)?(*a<*a):-1;
-// *b=(*b)?-1:(*b<*b);
+ *b=(*b)?-1:(*b<*b);
}
void h(vec*a){
*a=(~*a==5);
}
/* { dg-final { scan-tree-dump-not "~" "gimple" } } */
/* { dg-final { scan-tree-dump-not "VEC_COND_EXPR" "gimple" } } */
/* { dg-final { cleanup-tree-dump "gimple" } } */