2005-08-02 James A. Morrison <phython@gcc.gnu.org>
PR tree-optimization/23129
* tree-vrp.c (extract_range_from_binary_expr): Set value range to
varying for divisions with anti-ranges.
From-SVN: r102653
+2005-08-02 James A. Morrison <phython@gcc.gnu.org>
+
+ PR tree-optimization/23129
+ * tree-vrp.c (extract_range_from_binary_expr): Set value range to
+ varying for divisions with anti-ranges.
+
2005-08-02 Jan Hubicka <jh@suse.cz>
* tree-ssa-dom.c (thread_across_edge): Remove updating here.
+2005-08-02 James A. Morrison <phython@gcc.gnu.org>
+
+ * gcc.c-torture/execute/vrp-4.c: New test.
+
2005-08-02 Jan Hubicka <jh@suse.cz>
* update-threading.c: New test.
--- /dev/null
+extern void exit (int);
+extern void abort ();
+
+void test(int x, int y)
+{
+ int c;
+
+ if (x == 1) abort();
+ if (y == 1) abort();
+
+ c = x / y;
+
+ if (c != 1) abort();
+}
+
+int main()
+{
+ test(2, 2);
+ exit (0);
+}
the new range. */
/* Divisions by zero result in a VARYING value. */
- if (code != MULT_EXPR && range_includes_zero_p (&vr1))
+ if (code != MULT_EXPR
+ && (vr0.type == VR_ANTI_RANGE || range_includes_zero_p (&vr1)))
{
set_value_range_to_varying (vr);
return;