+2017-11-28 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/83158
+ * tree-vrp.c (intersect_ranges): Prefer ~[0, 0] in a few more
+ cases.
+
2017-11-28 Segher Boessenkool <segher@kernel.crashing.org>
PR 81288/target
&& vrp_val_is_max (vr1max))
;
/* Choose the anti-range if it is ~[0,0], that range is special
- enough to special case when vr1's range is relatively wide. */
+ enough to special case when vr1's range is relatively wide.
+ At least for types bigger than int - this covers pointers
+ and arguments to functions like ctz. */
else if (*vr0min == *vr0max
&& integer_zerop (*vr0min)
- && (TYPE_PRECISION (TREE_TYPE (*vr0min))
- == TYPE_PRECISION (ptr_type_node))
+ && ((TYPE_PRECISION (TREE_TYPE (*vr0min))
+ >= TYPE_PRECISION (integer_type_node))
+ || POINTER_TYPE_P (TREE_TYPE (*vr0min)))
&& TREE_CODE (vr1max) == INTEGER_CST
&& TREE_CODE (vr1min) == INTEGER_CST
&& (wi::clz (wi::to_wide (vr1max) - wi::to_wide (vr1min))