aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-chrec.c')
-rw-r--r--gcc/tree-chrec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 82c1fbefacf..b93ac70952a 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -220,16 +220,16 @@ chrec_fold_multiply_poly_poly (tree type,
/* "a*c". */
t0 = chrec_fold_multiply (type, CHREC_LEFT (poly0), CHREC_LEFT (poly1));
- /* "a*d + b*c + b*d". */
+ /* "a*d + b*c". */
t1 = chrec_fold_multiply (type, CHREC_LEFT (poly0), CHREC_RIGHT (poly1));
t1 = chrec_fold_plus (type, t1, chrec_fold_multiply (type,
CHREC_RIGHT (poly0),
CHREC_LEFT (poly1)));
- t1 = chrec_fold_plus (type, t1, chrec_fold_multiply (type,
- CHREC_RIGHT (poly0),
- CHREC_RIGHT (poly1)));
- /* "2*b*d". */
+ /* "b*d". */
t2 = chrec_fold_multiply (type, CHREC_RIGHT (poly0), CHREC_RIGHT (poly1));
+ /* "a*d + b*c + b*d". */
+ t1 = chrec_fold_plus (type, t1, t2);
+ /* "2*b*d". */
t2 = chrec_fold_multiply (type, SCALAR_FLOAT_TYPE_P (type)
? build_real (type, dconst2)
: build_int_cst (type, 2), t2);