if (element_precision (TREE_TYPE (targ1)) > element_precision (newtype))
newtype = TREE_TYPE (targ1);
- if (element_precision (newtype) < element_precision (TREE_TYPE (arg0)))
+ if (element_precision (newtype) < element_precision (TREE_TYPE (arg0))
+ && is_truth_type_for (newtype, type))
return fold_build2_loc (loc, code, type,
fold_convert_loc (loc, newtype, targ0),
fold_convert_loc (loc, newtype, targ1));
&& exact_real_truncate (TYPE_MODE (double_type_node), &orig))
type1 = double_type_node;
}
- tree newtype
- = (element_precision (TREE_TYPE (@00)) > element_precision (type1)
- ? TREE_TYPE (@00) : type1);
+ tree newtype
+ = (element_precision (TREE_TYPE (@00)) > element_precision (type1)
+ ? TREE_TYPE (@00) : type1);
}
- (if (element_precision (TREE_TYPE (@0)) > element_precision (newtype))
+ (if (element_precision (TREE_TYPE (@0)) > element_precision (newtype)
+ && is_truth_type_for (newtype, type))
(cmp (convert:newtype @00) (convert:newtype @10))))))))
--- /dev/null
+/* { dg-do compile } */
+
+typedef float __attribute__((__vector_size__ (8))) F;
+typedef double __attribute__((__vector_size__ (16))) G;
+
+F f;
+G g;
+
+F
+foo (void)
+{
+ G h = __builtin_convertvector (f, G);
+ g = h <= h;
+ return f;
+}