summaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-06-17 10:26:24 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-06-17 10:26:24 +0000
commit3cb8677cc030b145391ac547f159609b03dbbd6c (patch)
tree6565fa35aaddaec6451161a08051d6b81e16a68d /gcc/tree-chrec.c
parentd81b4c614be057ac515828a6b7a92745a542c551 (diff)
downloadgcc-3cb8677cc030b145391ac547f159609b03dbbd6c.tar.gz
re PR middle-end/40460 (Enormous memory usage during compilation with -O2 or -O3 optimizations.)
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. * g++.dg/torture/pr40460.C: New testcase. From-SVN: r148593
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 495f95a8be7..997ce893593 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);