summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-11 09:19:41 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-12-11 09:19:41 +0000
commit64243ab0fb231ba0528fb9bb6efd90a32bb85462 (patch)
tree000f1cb2606177d6c2c6952a5cfbd3062075c818 /gcc/tree-ssa-loop-niter.c
parent666655e480c5d6a3866d3b5c7d7dd685205aaafc (diff)
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205884 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 08c8541b490c..a5a76a497c33 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;
+ }
}
}
}