+2012-08-22 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/54317
+ * tree-vrp.c (extract_range_from_binary_expr_1): Test for
+ double_int overflow.
+ Remove dead tests.
+
2012-08-22 Jakub Jelinek <jakub@redhat.com>
* tree-vrp.c (find_assert_locations): Skip also edges
+2012-08-22 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/54317
+ * gcc.dg/tree-ssa/vrp79.c: New testcase.
+
2012-08-21 Oleg Endo <olegendo@gcc.gnu.org>
PR target/39423
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+#ifdef __SIZEOF_INT128__
+typedef unsigned __int128 NT;
+#else
+typedef unsigned long long NT;
+#endif
+
+extern void do_not_go_away ();
+
+void f (NT x, NT y)
+{
+ NT n = 1;
+ n <<= (__CHAR_BIT__ * sizeof (NT) - 1);
+ if (x > n) return;
+ if (y > n) return;
+ NT z = x + y;
+ if (z == 42) do_not_go_away ();
+}
+
+/* { dg-final { scan-tree-dump "do_not_go_away" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
{
/* Min underflow or max overflow. The range kind
changes to VR_ANTI_RANGE. */
+ bool covers = false;
double_int tem = tmin;
gcc_assert ((min_ovf == -1 && max_ovf == 0)
|| (max_ovf == 1 && min_ovf == 0));
type = VR_ANTI_RANGE;
tmin = double_int_add (tmax, double_int_one);
+ if (double_int_cmp (tmin, tmax, uns) < 0)
+ covers = true;
tmax = double_int_add (tem, double_int_minus_one);
+ if (double_int_cmp (tmax, tem, uns) > 0)
+ covers = true;
/* If the anti-range would cover nothing, drop to varying.
Likewise if the anti-range bounds are outside of the
types values. */
- if (double_int_cmp (tmin, tmax, uns) > 0
- || double_int_cmp (tmin, type_min, uns) < 0
- || double_int_cmp (tmax, type_max, uns) > 0)
+ if (covers || double_int_cmp (tmin, tmax, uns) > 0)
{
set_value_range_to_varying (vr);
return;