From: Richard Biener Date: Thu, 18 Oct 2018 08:40:54 +0000 (+0000) Subject: re PR tree-optimization/87087 (Optimization hangs up and consumes over 15Gb of memory) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=de0edf87351456822f4961e15aaeda2c3d5dbc12;p=gcc.git re PR tree-optimization/87087 (Optimization hangs up and consumes over 15Gb of memory) 2018-10-18 Richard Biener PR middle-end/87087 Revert 2018-02-07 Richard Biener 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 41a1dd13b67..11776764727 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2018-10-18 Richard Biener + + PR middle-end/87087 + Revert + 2018-02-07 Richard Biener + + PR tree-optimization/84204 + * tree-chrec.c (chrec_fold_plus_1): Remove size limiting in + this place. + 2018-10-18 H.J. Lu PR target/87537 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5e1ad063d9b..9cf4cbc4019 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-10-18 Richard Biener + + 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 PR target/87537 diff --git a/gcc/testsuite/gcc.dg/graphite/pr84204.c b/gcc/testsuite/gcc.dg/graphite/pr84204.c index 91401df609d..9e2d39ed5cc 100644 --- a/gcc/testsuite/gcc.dg/graphite/pr84204.c +++ b/gcc/testsuite/gcc.dg/graphite/pr84204.c @@ -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; diff --git a/gcc/testsuite/gcc.dg/graphite/pr85935.c b/gcc/testsuite/gcc.dg/graphite/pr85935.c index 8c63ea93770..4c05f546dc4 100644 --- a/gcc/testsuite/gcc.dg/graphite/pr85935.c +++ b/gcc/testsuite/gcc.dg/graphite/pr85935.c @@ -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; diff --git a/gcc/testsuite/gcc.dg/torture/pr87087.c b/gcc/testsuite/gcc.dg/torture/pr87087.c new file mode 100644 index 00000000000..2a076209c7e --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr87087.c @@ -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; + } +} diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c index 2717b40485b..a218327d772 100644 --- a/gcc/tree-chrec.c +++ b/gcc/tree-chrec.c @@ -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; } } }