From: Richard Biener Date: Mon, 4 Dec 2017 08:26:18 +0000 (+0000) Subject: re PR tree-optimization/83238 ([graphite] ICE in graphite_can_represent_scev, at... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5d66d3f151eab82a39fc89b6f0b973b529f6b3cb;p=gcc.git re PR tree-optimization/83238 ([graphite] ICE in graphite_can_represent_scev, at graphite-scop-detection.c:971) 2017-12-04 Richard Biener PR tree-optimization/83238 * graphite-scop-detection.c (scop_detection::merge_sese): Make code match comment, rejecting invalid SESE regions. * gcc.dg/graphite/pr83238.c: New testcase. From-SVN: r255375 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0940c186448..acde3e97806 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-04 Richard Biener + + PR tree-optimization/83238 + * graphite-scop-detection.c (scop_detection::merge_sese): Make + code match comment, rejecting invalid SESE regions. + 2017-12-03 John David Anglin * config/pa/pa.c (pa_legitimate_address_p): For scaled indexing, diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 0f09c1359dd..3d854a13e6f 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -570,8 +570,7 @@ scop_detection::merge_sese (sese_l first, sese_l second) const which post-dominates dom, until it stabilizes. Also, ENTRY->SRC and EXIT->DEST should be in the same loop nest. */ if (!dominated_by_p (CDI_DOMINATORS, pdom, dom) - || loop_depth (entry->src->loop_father) - != loop_depth (exit->dest->loop_father)) + || entry->src->loop_father != exit->dest->loop_father) return invalid_sese; /* For now we just bail out when there is a loop exit in the region diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3d7ad8ace0f..d49bbe483c1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-04 Richard Biener + + PR tree-optimization/83238 + * gcc.dg/graphite/pr83238.c: New testcase. + 2017-12-04 Tom de Vries * gcc.dg/pr82875.c: Require effective target alloca. diff --git a/gcc/testsuite/gcc.dg/graphite/pr83238.c b/gcc/testsuite/gcc.dg/graphite/pr83238.c new file mode 100644 index 00000000000..4b640f29a6a --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr83238.c @@ -0,0 +1,39 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -floop-parallelize-all" } */ + +void +vw (int *dk, int zd, int jb) +{ + int sq; + int *kv = &sq; + + for (sq = 0; sq < 2; ++sq) + { + int u1; + + for (u1 = 0; u1 < 5; ++u1) + if (zd == 0) + return; + } + + for (;;) + { + ++zd; + if (zd == 0) + while (jb != 0) + kv = &jb; + + while (*dk < 1) + { + for (jb = 0; jb < 2; ++jb) + { + } + ++*dk; + } + + for (*kv = 0; *kv < 2; ++*kv) + for (*dk = 0; *dk < 2; ++*dk) + { + } + } +}