diff options
author | Ian Lance Taylor <iant@google.com> | 2007-03-26 21:43:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2007-03-26 21:43:30 +0000 |
commit | fa6338517fd9e503ab4b634d9eec7c875fcea7ec (patch) | |
tree | 04800cbd7818dfff26637d50f412f6a224326008 /gcc | |
parent | 0d67a675f058ea075a64d3675ca8b9b7322594fd (diff) | |
download | gcc-fa6338517fd9e503ab4b634d9eec7c875fcea7ec.zip gcc-fa6338517fd9e503ab4b634d9eec7c875fcea7ec.tar.gz gcc-fa6338517fd9e503ab4b634d9eec7c875fcea7ec.tar.bz2 |
re PR tree-optimization/31345 (ICE in set_value_range, at tree-vrp.c:269)
./: PR tree-optimization/31345
* tree-vrp.c (extract_range_from_binary_expr): Turn ranges like
[+INF, +INF(OVF)] into VARYING.
testsuite/:
PR tree-optimization/31345
* gcc.c-torture/compile/pr31345-1.c: New test.
From-SVN: r123237
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr31345-1.c | 24 | ||||
-rw-r--r-- | gcc/tree-vrp.c | 12 |
4 files changed, 45 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0dc2ec5..b863665 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2007-03-26 Ian Lance Taylor <iant@google.com> + + PR tree-optimization/31345 + * tree-vrp.c (extract_range_from_binary_expr): Turn ranges like + [+INF, +INF(OVF)] into VARYING. + 2007-03-26 Zack Weinberg <zackw@panix.com> * gengtype-parse.c: New file. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d9fa344..7ba80be 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-03-26 Ian Lance Taylor <iant@google.com> + + PR tree-optimization/31345 + * gcc.c-torture/compile/pr31345-1.c: New test. + 2007-03-26 Brooks Moses <brooks.moses@codesourcery.com> * gfortran.dg/func_derived_4.f90: Fix module cleanup. diff --git a/gcc/testsuite/gcc.c-torture/compile/pr31345-1.c b/gcc/testsuite/gcc.c-torture/compile/pr31345-1.c new file mode 100644 index 0000000..fb4d803 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr31345-1.c @@ -0,0 +1,24 @@ +/* PR tree-optimization/31345 + This caused a crash in VRP when dealing with overflow infinities. */ + +void +dpsnaffle (const char *kbuf) +{ + int hash, thash, head[2], off; + { + int _DP_i; + (hash) = 19780211; + { + (hash) = (hash) + (kbuf)[_DP_i]; + } + (hash) = ((hash) * 43321879) & 0x7FFFFFFF; + } + while (off != 0) + { + if (hash > thash) {} + else if (hash < thash) + { + off = head[2]; + } + } +} diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 262eeb2..3b7358d 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -1982,10 +1982,18 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr) return; } + /* We punt if: + 1) [-INF, +INF] + 2) [-INF, +-INF(OVF)] + 3) [+-INF(OVF), +INF] + 4) [+-INF(OVF), +-INF(OVF)] + We learn nothing when we have INF and INF(OVF) on both sides. + Note that we do accept [-INF, -INF] and [+INF, +INF] without + overflow. */ if ((min == TYPE_MIN_VALUE (TREE_TYPE (min)) - || is_negative_overflow_infinity (min)) + || is_overflow_infinity (min)) && (max == TYPE_MAX_VALUE (TREE_TYPE (max)) - || is_positive_overflow_infinity (max))) + || is_overflow_infinity (max))) { set_value_range_to_varying (vr); return; |