diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-12-11 10:19:41 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-12-11 10:19:41 +0100 |
commit | 20adc5b14897a3705f708982c4887db66d49835d (patch) | |
tree | 000f1cb2606177d6c2c6952a5cfbd3062075c818 /gcc/tree-ssa-loop-niter.c | |
parent | f8cb36a94c67ec4723475e68df75f9571b4ed198 (diff) | |
download | gcc-20adc5b14897a3705f708982c4887db66d49835d.zip gcc-20adc5b14897a3705f708982c4887db66d49835d.tar.gz gcc-20adc5b14897a3705f708982c4887db66d49835d.tar.bz2 |
re PR tree-optimization/59417 (ICE in determine_value_range, at tree-ssa-loop-niter.c:176)
PR tree-optimization/59417
* tree-ssa-copy.c (fini_copy_prop): If copy_of[i].value is defined
in a different bb rhan var, only duplicate points-to info and
not alignment info and don't duplicate range info.
* tree-ssa-loop-niter.c (determine_value_range): Instead of
assertion failure handle inconsistencies in range info by only
using var's range info and not PHI result range infos.
* gcc.c-torture/compile/pr59417.c: New test.
From-SVN: r205884
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 08c8541..a5a76a4 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -173,7 +173,15 @@ determine_value_range (struct loop *loop, tree type, tree var, mpz_t off, { minv = minv.max (minc, TYPE_UNSIGNED (type)); maxv = maxv.min (maxc, TYPE_UNSIGNED (type)); - gcc_assert (minv.cmp (maxv, TYPE_UNSIGNED (type)) <= 0); + /* If the PHI result range are inconsistent with + the VAR range, give up on looking at the PHI + results. This can happen if VR_UNDEFINED is + involved. */ + if (minv.cmp (maxv, TYPE_UNSIGNED (type)) > 0) + { + rtype = get_range_info (var, &minv, &maxv); + break; + } } } } |