@@ -2857,6 +2857,7 @@ extract_range_from_binary_expr_1 (value_
bool int_cst_range0, int_cst_range1;
wide_int may_be_nonzero0, may_be_nonzero1;
wide_int must_be_nonzero0, must_be_nonzero1;
+ tree minxx = NULL_TREE, maxxx = NULL_TREE;
int_cst_range0 = zero_nonzero_bits_from_vr (expr_type, &vr0,
&may_be_nonzero0,
@@ -2908,8 +2909,8 @@ extract_range_from_binary_expr_1 (value_
wide_int mask = wi::mask (m + n, true, w.get_precision ());
if (wi::eq_p (mask & vr0p->min, mask & vr0p->max))
{
- min = int_const_binop (code, vr0p->min, vr1p->min);
- max = int_const_binop (code, vr0p->max, vr1p->min);
+ minxx = int_const_binop (code, vr0p->min, vr1p->min);
+ maxxx = int_const_binop (code, vr0p->max, vr1p->min);
}
}
}
@@ -3000,6 +3001,33 @@ extract_range_from_binary_expr_1 (value_
else
max = min = NULL_TREE;
}
+ if (minxx && maxxx)
+ {
+ int z1, z2;
+ if (min && !TREE_OVERFLOW (min))
+ z1 = compare_values (min, minxx);
+ else
+ z1 = -3;
+ if (max && !TREE_OVERFLOW (max))
+ z2 = compare_values (max, maxxx);
+ else
+ z2 = -3;
+ if (min && max)
+ {
+ int z3 = compare_values (min, max);
+ if (z3 == -2 || z3 == 1)
+ {
+ z1 = -4;
+ z2 = -4;
+ }
+ }
+
+ FILE *f = fopen ("/tmp/vrpz", "a");
+ fprintf (f, "%d %d %d %s %s\n", z1, z2, (int) BITS_PER_WORD, main_input_filename ? main_input_filename : "-", current_function_name ());
+ fclose (f);
+ min = minxx;
+ max = maxxx;
+ }
}
else
gcc_unreachable ();