Commit 08303d5b by James A. Morrison

re PR tree-optimization/23129 (VRP propagates division of antiranges incorrectly)

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
parent bf2f9588
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.
......
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);
}
......@@ -1136,7 +1136,8 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment