summaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-13 18:23:03 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-13 18:23:03 +0000
commit72aad60a23e30fbd7949470a9ab18f6af134297a (patch)
tree2a51c38968aa2cc2736236248ae0b477efeddf34 /gcc/tree-chrec.c
parent99fb47822ca2b127ba2c7edf0e30600fc6a9d6e1 (diff)
downloadgcc-72aad60a23e30fbd7949470a9ab18f6af134297a.tar.gz
PR tree-optimization/34063
* tree-chrec.c (chrec_evaluate): Put CHREC_LEFT based argument as first chrec_fold_plus operand rather than second. * g++.dg/tree-ssa/pr34063.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130151 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r--gcc/tree-chrec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index d46cfda5529..37b7c0d671d 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -522,13 +522,13 @@ chrec_evaluate (unsigned var, tree chrec, tree n, unsigned int k)
if (TREE_CODE (chrec) == POLYNOMIAL_CHREC
&& CHREC_VARIABLE (chrec) == var)
{
- arg0 = chrec_evaluate (var, CHREC_RIGHT (chrec), n, k + 1);
- if (arg0 == chrec_dont_know)
+ arg1 = chrec_evaluate (var, CHREC_RIGHT (chrec), n, k + 1);
+ if (arg1 == chrec_dont_know)
return chrec_dont_know;
binomial_n_k = tree_fold_binomial (type, n, k);
if (!binomial_n_k)
return chrec_dont_know;
- arg1 = fold_build2 (MULT_EXPR, type,
+ arg0 = fold_build2 (MULT_EXPR, type,
CHREC_LEFT (chrec), binomial_n_k);
return chrec_fold_plus (type, arg0, arg1);
}