Commit 3cb8677c by Richard Guenther Committed by Richard Biener

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
parent d81b4c61
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-16 J"orn Rennecke <joern.rennecke@arc.com>
Janis Johnson <janis187@us.ibm.com>
......
2009-06-17 Richard Guenther <rguenther@suse.de>
PR middle-end/40460
* g++.dg/torture/pr40460.C: New testcase.
2009-06-05 Olatunji Ruwase <tjruwase@google.com>
* gcc.dg/plugin/one_time_plugin.c: New test.
......
/* { dg-do compile } */
void bar(int);
void foo(void)
{
for (int i = 0; i<1; ++i)
bar (i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i*i);
}
......@@ -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);
......
......@@ -132,7 +132,8 @@ build_polynomial_chrec (unsigned loop_num,
|| 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment