From b2bf82589273884743923aa780c9479965609070 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 7 Jun 2018 07:01:56 +0000 Subject: [PATCH] re PR tree-optimization/85935 ([graphite] ICE in extract_affine, at graphite-sese-to-poly.c:287) 2018-06-07 Richard Biener PR tree-optimization/85935 * graphite-scop-detection.c (find_params_in_bb): Analyze condition operands with respect to the correct loop. Assert the analysis doesn't fail. * gcc.dg/graphite/pr85935.c: New testcase. From-SVN: r261263 --- gcc/ChangeLog | 7 +++++++ gcc/graphite-scop-detection.c | 4 +++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/graphite/pr85935.c | 25 +++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/graphite/pr85935.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4eaaa70b1c2..f6f3fe78f10 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-06-07 Richard Biener + + PR tree-optimization/85935 + * graphite-scop-detection.c (find_params_in_bb): Analyze + condition operands with respect to the correct loop. Assert + the analysis doesn't fail. + 2018-06-04 Carl Love * gcc/config/rs6000/vsx.md (first_match_index_): Calculate index diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 48e40142e59..0dafc399521 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1176,13 +1176,15 @@ find_params_in_bb (sese_info_p region, gimple_poly_bb_p gbb) /* Find parameters in conditional statements. */ gimple *stmt; - loop_p loop = GBB_BB (gbb)->loop_father; FOR_EACH_VEC_ELT (GBB_CONDITIONS (gbb), i, stmt) { + loop_p loop = gimple_bb (stmt)->loop_father; tree lhs = scalar_evolution_in_region (region->region, loop, gimple_cond_lhs (stmt)); tree rhs = scalar_evolution_in_region (region->region, loop, gimple_cond_rhs (stmt)); + gcc_assert (!chrec_contains_undetermined (lhs) + && !chrec_contains_undetermined (rhs)); scan_tree_for_params (region, lhs); scan_tree_for_params (region, rhs); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index db46ffc4e7c..989e497704f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-07 Richard Biener + + PR tree-optimization/85935 + * gcc.dg/graphite/pr85935.c: New testcase. + 2018-06-04 Carl Love * gcc.target/powerpc/builtins-8-p9-runnable.c: Add additional diff --git a/gcc/testsuite/gcc.dg/graphite/pr85935.c b/gcc/testsuite/gcc.dg/graphite/pr85935.c new file mode 100644 index 00000000000..8c63ea93770 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr85935.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ +/* { dg-options "-O -floop-parallelize-all -fno-tree-loop-im --param scev-max-expr-size=3" } */ + +typedef int dq; + +int gb; + +void +qq (dq ww, int kk) +{ + dq *up = &ww; + + (void) *up; + + while (kk < 1) + { + ++ww; + + if (ww == 0) + for (gb = 0; gb < 2; ++gb) + ; + + ++kk; + } +} -- 2.30.2