aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2006-07-07 12:31:29 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2006-07-07 12:31:29 +0000
commit1ce35d260ce28d8bf428ef923169899be85a382e (patch)
tree6302ef291529a9f7d84576775cadb3ee62a10839 /gcc/tree-vrp.c
parentb5b1842549c359a16002b52b0de2b82183c1735b (diff)
downloadgcc-1ce35d260ce28d8bf428ef923169899be85a382e.zip
gcc-1ce35d260ce28d8bf428ef923169899be85a382e.tar.gz
gcc-1ce35d260ce28d8bf428ef923169899be85a382e.tar.bz2
re PR tree-optimization/28187 ('-O2 -fwrapv' exhausts memory.)
2006-07-07 Richard Guenther <rguenther@suse.de> PR tree-optimization/28187 * tree-vrp.c (vrp_operand_equal_p): New function. (vrp_bitmap_equal_p): Likewise. (update_value_range): Use them to compare old and new max and min values. * gcc.dg/pr28187.c: New testcase. From-SVN: r115255
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 9eac7e9..64f292e 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -290,6 +290,25 @@ get_value_range (tree var)
return vr;
}
+/* Return true, if VAL1 and VAL2 are equal values for VRP purposes. */
+
+static inline bool
+vrp_operand_equal_p (tree val1, tree val2)
+{
+ return (val1 == val2
+ || (val1 && val2
+ && operand_equal_p (val1, val2, 0)));
+}
+
+/* Return true, if the bitmaps B1 and B2 are equal. */
+
+static inline bool
+vrp_bitmap_equal_p (bitmap b1, bitmap b2)
+{
+ return (b1 == b2
+ || (b1 && b2
+ && bitmap_equal_p (b1, b2)));
+}
/* Update the value range and equivalence set for variable VAR to
NEW_VR. Return true if NEW_VR is different from VAR's previous
@@ -310,11 +329,9 @@ update_value_range (tree var, value_range_t *new_vr)
/* Update the value range, if necessary. */
old_vr = get_value_range (var);
is_new = old_vr->type != new_vr->type
- || old_vr->min != new_vr->min
- || old_vr->max != new_vr->max
- || (old_vr->equiv == NULL && new_vr->equiv)
- || (old_vr->equiv && new_vr->equiv == NULL)
- || (!bitmap_equal_p (old_vr->equiv, new_vr->equiv));
+ || !vrp_operand_equal_p (old_vr->min, new_vr->min)
+ || !vrp_operand_equal_p (old_vr->max, new_vr->max)
+ || !vrp_bitmap_equal_p (old_vr->equiv, new_vr->equiv);
if (is_new)
set_value_range (old_vr, new_vr->type, new_vr->min, new_vr->max,