re PR tree-optimization/87087 (Optimization hangs up and consumes over 15Gb of memory)

2018-10-18  Richard Biener  <rguenther@suse.de>

	PR middle-end/87087
	Revert
	2018-02-07  Richard Biener  <rguenther@suse.de>

        PR tree-optimization/84204
        * tree-chrec.c (chrec_fold_plus_1): Remove size limiting in
        this place.

	* gcc.dg/torture/pr87087.c: New testcase.
	* gcc.dg/graphite/pr84204.c: XFAIL.
	* gcc.dg/graphite/pr85935.c: Likewise.

From-SVN: r265261
This commit is contained in:
Richard Biener 2018-10-18 08:40:54 +00:00 committed by Richard Biener
parent 294973a497
commit de0edf8735
6 changed files with 53 additions and 3 deletions

View File

@ -1,3 +1,13 @@
2018-10-18 Richard Biener <rguenther@suse.de>
PR middle-end/87087
Revert
2018-02-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/84204
* tree-chrec.c (chrec_fold_plus_1): Remove size limiting in
this place.
2018-10-18 H.J. Lu <hongjiu.lu@intel.com>
PR target/87537

View File

@ -1,3 +1,10 @@
2018-10-18 Richard Biener <rguenther@suse.de>
PR middle-end/87087
* gcc.dg/torture/pr87087.c: New testcase.
* gcc.dg/graphite/pr84204.c: XFAIL.
* gcc.dg/graphite/pr85935.c: Likewise.
2018-10-18 H.J. Lu <hongjiu.lu@intel.com>
PR target/87537

View File

@ -1,5 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O -floop-parallelize-all -fno-tree-loop-im --param scev-max-expr-size=3" } */
/* The fix for PR84204 was reverted. */
/* { dg-additional-options "--param graphite-allow-codegen-errors=1" } */
int oc;

View File

@ -1,5 +1,7 @@
/* { dg-do compile } */
/* { dg-options "-O -floop-parallelize-all -fno-tree-loop-im --param scev-max-expr-size=3" } */
/* The fix for PR84204 was reverted. */
/* { dg-additional-options "--param graphite-allow-codegen-errors=1" } */
typedef int dq;

View File

@ -0,0 +1,25 @@
/* { dg-do compile } */
/* { dg-require-effective-target int32plus } */
int b;
int d;
void e()
{
unsigned f;
unsigned g;
int h;
long i = 901380;
for (;;) {
d = 0;
for (; d; d++) {
h = 143366620;
f = 0;
for (; f < 15; f += 3) {
g = 0;
for (; g < 9; g++)
b = h = i - (h << 5) + h;
}
}
i = 0;
}
}

View File

@ -328,10 +328,12 @@ chrec_fold_plus_1 (enum tree_code code, tree type,
default:
{
if (tree_contains_chrecs (op0, NULL)
|| tree_contains_chrecs (op1, NULL))
int size = 0;
if ((tree_contains_chrecs (op0, &size)
|| tree_contains_chrecs (op1, &size))
&& size < PARAM_VALUE (PARAM_SCEV_MAX_EXPR_SIZE))
return build2 (code, type, op0, op1);
else
else if (size < PARAM_VALUE (PARAM_SCEV_MAX_EXPR_SIZE))
{
if (code == POINTER_PLUS_EXPR)
return fold_build_pointer_plus (fold_convert (type, op0),
@ -341,6 +343,8 @@ chrec_fold_plus_1 (enum tree_code code, tree type,
fold_convert (type, op0),
fold_convert (type, op1));
}
else
return chrec_dont_know;
}
}
}