aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorSebastian Pop <pop@cri.ensmp.fr>2005-09-09 12:56:41 +0200
committerSebastian Pop <spop@gcc.gnu.org>2005-09-09 10:56:41 +0000
commit18aed06a02f80320c60d5cd2ce1fc30b5b676eb1 (patch)
treec7edd2ccfdc78d98667b7a53d37015f541602224 /gcc/tree-ssa-loop-niter.c
parent35885ceb44d03c909d9e271c8a934b5b1f901790 (diff)
downloadgcc-18aed06a02f80320c60d5cd2ce1fc30b5b676eb1.zip
gcc-18aed06a02f80320c60d5cd2ce1fc30b5b676eb1.tar.gz
gcc-18aed06a02f80320c60d5cd2ce1fc30b5b676eb1.tar.bz2
Makefile.in (tree-chrec.o): Depends on SCEV_H.
* Makefile.in (tree-chrec.o): Depends on SCEV_H. * tree-chrec.c: Include tree-scalar-evolution.h. (chrec_convert): Instantiate the base and step before calling scev_probably_wraps_p that would fail on parametric evolutions. Collect all the fails into a single section failed_to_convert, print a diagnostic, and return chrec_dont_know instead of calling fold_convert. * tree-scalar-evolution.c (loop_closed_phi_def): New. (instantiate_parameters_1): Avoid instantiation of loop closed ssa phi nodes. (scev_const_prop): Don't replace the definition of a loop closed ssa phi node by itself, or by another loop closed ssa phi node. * tree-ssa-loop-niter.c (scev_probably_wraps_p, convert_step): Check that base and step are defined. From-SVN: r104092
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 3ee27f4..b866418 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1857,7 +1857,9 @@ scev_probably_wraps_p (tree type, tree base, tree step,
}
}
- if (TREE_CODE (base) == REAL_CST
+ if (chrec_contains_undetermined (base)
+ || chrec_contains_undetermined (step)
+ || TREE_CODE (base) == REAL_CST
|| TREE_CODE (step) == REAL_CST)
{
*unknown_max = true;
@@ -1978,7 +1980,13 @@ tree
convert_step (struct loop *loop, tree new_type, tree base, tree step,
tree at_stmt)
{
- tree base_type = TREE_TYPE (base);
+ tree base_type;
+
+ if (chrec_contains_undetermined (base)
+ || chrec_contains_undetermined (step))
+ return NULL_TREE;
+
+ base_type = TREE_TYPE (base);
/* When not using wrapping arithmetic, signed types don't wrap. */
if (!flag_wrapv && !TYPE_UNSIGNED (base_type))