From b33086c0a74ecc4ca0abb4011bb30564198f034e Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 8 Jan 2018 15:04:53 +0000 Subject: [PATCH] re PR tree-optimization/83563 ([graphite] ICE: Segmentation fault (in instantiate_scev_r)) 2018-01-08 Richard Biener PR tree-optimization/83563 * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV cache. * gcc.dg/graphite/pr83563.c: New testcase. From-SVN: r256343 --- gcc/ChangeLog | 6 ++++++ gcc/graphite.c | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/graphite/pr83563.c | 15 +++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/graphite/pr83563.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b91925a7128..f8d2b34ea72 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-08 Richard Biener + + PR tree-optimization/83563 + * graphite.c (canonicalize_loop_closed_ssa_form): Reset the SCEV + cache. + 2018-01-08 Richard Biener PR middle-end/83713 diff --git a/gcc/graphite.c b/gcc/graphite.c index fb8437c4b89..8208d3dc32b 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -322,6 +322,10 @@ canonicalize_loop_closed_ssa_form (void) FOR_EACH_LOOP (loop, LI_FROM_INNERMOST) canonicalize_loop_closed_ssa (loop); + /* We can end up releasing duplicate exit PHIs and also introduce + additional copies so the cached information isn't correct anymore. */ + scev_reset (); + checking_verify_loop_closed_ssa (true); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d5fd96d05c1..562b5a0053b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-08 Richard Biener + + PR tree-optimization/83563 + * gcc.dg/graphite/pr83563.c: New testcase. + 2018-01-08 Richard Biener PR middle-end/83713 diff --git a/gcc/testsuite/gcc.dg/graphite/pr83563.c b/gcc/testsuite/gcc.dg/graphite/pr83563.c new file mode 100644 index 00000000000..c1ca39eaa83 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr83563.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-options "-O -fgraphite -ftree-loop-distribution -fno-tree-dominator-opts -fno-tree-sink -fno-tree-dce" } */ + +void +sy (void) +{ + int hb; + + for (hb = 1; hb != 0; hb += hb) + { + } + + while (hb < 1) + ++hb; +} -- 2.30.2