summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-27 20:27:20 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-27 20:27:20 +0000
commitdede8dccf78be0a4041a7ca47d26f709e888f1fa (patch)
tree36323e61beca852219425c346a9efad5a6b0dfb5 /gcc/tree-ssa-loop-niter.c
parent5fd0f19b793f1e60a0d310d6f07ceff2e8eaa7ed (diff)
downloadgcc-dede8dccf78be0a4041a7ca47d26f709e888f1fa.tar.gz
PR tree-optimization/18048
* fold-const.c (try_move_mult_to_index): New function. (fold): Use try_move_mult_to_index. * tree-ssa-loop-ivopts.c (try_add_cand_for): Prefer common candidates. * tree-ssa-loop-niter.c (number_of_iterations_cond): Produce an all-ones unsigned constant without extra bits. * tree.c (build_low_bits_mask): New function. * tree.h (build_low_bits_mask): Declare. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89708 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index b879b9e7a4c..496b3f3eebd 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -419,9 +419,10 @@ number_of_iterations_cond (tree type, tree base0, tree step0,
d = EXEC_BINARY (LSHIFT_EXPR, niter_type,
build_int_cst_type (niter_type, 1), bits);
s = EXEC_BINARY (RSHIFT_EXPR, niter_type, step0, bits);
- bound = EXEC_BINARY (RSHIFT_EXPR, niter_type,
- build_int_cst (niter_type, -1),
- bits);
+
+ bound = build_low_bits_mask (niter_type,
+ (TYPE_PRECISION (niter_type)
+ - tree_low_cst (bits, 1)));
assumption = fold (build2 (FLOOR_MOD_EXPR, niter_type, base1, d));
assumption = fold (build2 (EQ_EXPR, boolean_type_node,