@@ -1139,7 +1139,8 @@ fold_using_range::condexpr_adjust (vrange &r1, vrange &r2, gimple *, tree cond,
|| TREE_CODE_CLASS (gimple_assign_rhs_code (cond_def)) != tcc_comparison)
return false;
tree type = TREE_TYPE (gimple_assign_rhs1 (cond_def));
- if (!range_compatible_p (type, TREE_TYPE (gimple_assign_rhs2 (cond_def))))
+ if (!value_range::supports_type_p (type)
+ || !range_compatible_p (type, TREE_TYPE (gimple_assign_rhs2 (cond_def))))
return false;
range_op_handler hand (gimple_assign_rhs_code (cond_def));
if (!hand)
new file mode 100644
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-msse4" { target { x86_64-*-* i?86-*-* } } } */
+
+int a, b;
+_Complex long c;
+
+void
+foo ()
+{
+ do
+ b = c || a;
+ while (a);
+}