+2015-11-23 Richard Biener <rguenth@gcc.gnu.org>
+ Jiong Wang <jiong.wang@arm.com>
+
+ PR tree-optimization/68317
+ PR tree-optimization/68326
+ * tree-vrp.c (adjust_range_with_scev): Call drop_tree_overflow if the
+ final min and max are not infinity.
+
2015-11-23 Ilya Enkovich <enkovich.gnu@gmail.com>
Richard Biener <rguenther@suse.de>
+2015-11-23 Richard Biener <rguenther@suse.de>
+ Jiong Wang <jiong.wang@arm.com>
+
+ PR tree-optimization/68317
+ PR tree-optimization/68326
+ * gcc.dg/pr68317.c: New testcase.
+
2015-11-23 Ilya Enkovich <enkovich.gnu@gmail.com>
PR tree-optimization/68327
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+void bar (int);
+
+void
+foo ()
+{
+ int index = 0;
+
+ for (index; index <= 10; index--)
+ /* Result of the following multiply will overflow
+ when converted to signed int. */
+ bar ((0xcafe + index) * 0xdead);
+}
&& is_positive_overflow_infinity (max)))
return;
+ /* Even for valid range info, sometimes overflow flag will leak in.
+ As GIMPLE IL should have no constants with TREE_OVERFLOW set, we
+ drop them except for +-overflow_infinity which still need special
+ handling in vrp pass. */
+ if (TREE_OVERFLOW_P (min)
+ && ! is_negative_overflow_infinity (min))
+ min = drop_tree_overflow (min);
+ if (TREE_OVERFLOW_P (max)
+ && ! is_positive_overflow_infinity (max))
+ max = drop_tree_overflow (max);
+
set_value_range (vr, VR_RANGE, min, max, vr->equiv);
}