X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftree-vrp.c;h=a5028b4d8f59862284c4bdaf568ee9d5c4cfceab;hb=89370a1eb374e74c85ca1a61447b853ee4f0c938;hp=7fcd62d0fb99aab7c415886ae3443fd2e893423f;hpb=92f11134fa0f468e3ce8bf544ec38fd4218f1713;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 7fcd62d0fb9..a5028b4d8f5 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1,5 +1,5 @@ /* Support routines for Value Range Propagation (VRP). - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2006 Free Software Foundation, Inc. Contributed by Diego Novillo . This file is part of GCC. @@ -3970,7 +3970,7 @@ test_for_singularity (enum tree_code cond_code, tree op0, if (cond_code == GT_EXPR) { tree one = build_int_cst (TREE_TYPE (op0), 1); - max = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), max, one); + min = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), min, one); } } @@ -3987,10 +3987,10 @@ test_for_singularity (enum tree_code cond_code, tree op0, else max = vr->max; - /* If the new min/max values have converged to a - single value, then there is only one value which - can satisfy the condition, return that value. */ - if (min == max && is_gimple_min_invariant (min)) + /* If the new min/max values have converged to a single value, + then there is only one value which can satisfy the condition, + return that value. */ + if (operand_equal_p (min, max, 0) && is_gimple_min_invariant (min)) return min; } return NULL;