diff options
author | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-24 22:55:15 +0000 |
---|---|---|
committer | rakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-05-24 22:55:15 +0000 |
commit | 57e3f39a03f36b17be20342c52046ec2747949ab (patch) | |
tree | 1cb568e88ce4a846caaddba12bd18eb12329f4b8 /gcc/tree-scalar-evolution.c | |
parent | fc9d61a25902ed5b2961c433dd0c71f5e776aa56 (diff) | |
download | gcc-57e3f39a03f36b17be20342c52046ec2747949ab.tar.gz |
PR tree-optimization/27639
PR tree-optimization/26719
* tree-vrp.c (adjust_range_with_scev): Use scev_direction and adjust
call to scev_probably_wraps_p.
* tree-ssa-loop-niter.c (compare_trees, convert_step_widening,
used_in_pointer_arithmetic_p, convert_step): Removed.
(nowrap_type_p): New function.
(scev_probably_wraps_p): Rewritten.
* tree-scalar-evolution.c (instantiate_parameters_1): Do not call
chrec_convert if chrec_convert_aggressive might have been used.
* tree-chrec.c (convert_affine_scev, chrec_convert_1,
scev_direction): New functions.
(chrec_convert): Changed to a wrapper over chrec_convert_1.
* tree-ssa-loop-ivopts.c (idx_find_step): Use convert_affine_scev
instead of convert_step.
* tree-flow.h (scev_probably_wraps_p): Declaration changed.
(convert_step): Declaration removed.
(convert_affine_scev, nowrap_type_p, scev_direction): Declare.
* gcc.dg/pr27639.c: New test.
* gcc.dg/pr26719.c: New test.
* gcc.dg/tree-ssa/scev-cast.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114057 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-scalar-evolution.c')
-rw-r--r-- | gcc/tree-scalar-evolution.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 22ca912f38c..52b0ba38b67 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -2132,6 +2132,12 @@ instantiate_parameters_1 (struct loop *loop, tree chrec, int flags, htab_t cache if (op0 == TREE_OPERAND (chrec, 0)) return chrec; + /* If we used chrec_convert_aggressive, we can no longer assume that + signed chrecs do not overflow, as chrec_convert does, so avoid + calling it in that case. */ + if (flags & FOLD_CONVERSIONS) + return fold_convert (TREE_TYPE (chrec), op0); + return chrec_convert (TREE_TYPE (chrec), op0, NULL_TREE); case SCEV_NOT_KNOWN: |