+2009-01-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/38934
+ * tree-vrp.c (extract_range_from_assert): For LE_EXPR and LT_EXPR
+ set to varying whenever max has TREE_OVERFLOW set, similarly
+ for GE_EXPR and GT_EXPR and TREE_OVERFLOW min.
+
2009-01-28 Richard Guenther <rguenther@suse.de>
PR middle-end/38908
--- /dev/null
+/* PR middle-end/38934 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -std=gnu99 -w" } */
+
+/* This variable needed only to work around earlier optimizations than VRP. */
+unsigned char g;
+
+extern void abort ();
+
+void
+f (long long int p)
+{
+ g = 255;
+ if (p >= -9223372036854775808LL - (signed char) g)
+ p = 1;
+
+ if (p)
+ abort ();
+}
all should be optimized away above us. */
if ((cond_code == LT_EXPR
&& compare_values (max, min) == 0)
- || is_overflow_infinity (max))
+ || (CONSTANT_CLASS_P (max) && TREE_OVERFLOW (max)))
set_value_range_to_varying (vr_p);
else
{
all should be optimized away above us. */
if ((cond_code == GT_EXPR
&& compare_values (min, max) == 0)
- || is_overflow_infinity (min))
+ || (CONSTANT_CLASS_P (min) && TREE_OVERFLOW (min)))
set_value_range_to_varying (vr_p);
else
{