+2009-06-17 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/40460
+ * tree-chrec.h (build_polynomial_chrec): If we cannot determine
+ if there is no evolution of left in the loop bail out.
+ * tree-chrec.c (chrec_fold_multiply_poly_poly): CSE one
+ chrec_fold_multiply.
+
2009-06-11 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline:
/* "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);
|| right == chrec_dont_know)
return chrec_dont_know;
- if (no_evolution_in_loop_p (left, loop_num, &val) && !val)
+ if (!no_evolution_in_loop_p (left, loop_num, &val)
+ || !val)
return chrec_dont_know;
/* Pointer types should occur only on the left hand side, i.e. in