summaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-23 10:47:34 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-23 10:47:34 +0000
commitc311b856b2cba0c426fdc646db8ae60a59f035c0 (patch)
tree82eb7f2396f54b578dc352f34d49acdd01bb3d25 /gcc/tree-chrec.c
parenta87365c70a434f981dcbe71d287d0197d99424f5 (diff)
downloadgcc-c311b856b2cba0c426fdc646db8ae60a59f035c0.tar.gz
Tweak uses of new API
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209689 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r--gcc/tree-chrec.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 972fac0ebf8..c78d9410429 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -490,21 +490,18 @@ tree_fold_binomial (tree type, tree n, unsigned int k)
if (k == 1)
return fold_convert (type, n);
- /* Numerator = n. */
- wide_int num = n;
-
/* Check that k <= n. */
- if (wi::ltu_p (num, k))
+ if (wi::ltu_p (n, k))
return NULL_TREE;
/* Denominator = 2. */
wide_int denom = wi::two (TYPE_PRECISION (TREE_TYPE (n)));
/* Index = Numerator-1. */
- wide_int idx = num - 1;
+ wide_int idx = wi::sub (n, 1);
/* Numerator = Numerator*Index = n*(n-1). */
- num = wi::smul (num, idx, &overflow);
+ wide_int num = wi::smul (n, idx, &overflow);
if (overflow)
return NULL_TREE;