diff options
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; + } } } } |