From: Richard Biener Date: Tue, 23 Jan 2018 08:00:20 +0000 (+0000) Subject: re PR tree-optimization/83963 ([graphite] ICE in merge_sese, at graphite-scop-detecti... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=950d1cd9ba49d2420f77ae0bc04be4fd6d0d009e;p=gcc.git re PR tree-optimization/83963 ([graphite] ICE in merge_sese, at graphite-scop-detection.c:517) 2018-01-23 Richard Biener PR tree-optimization/83963 * graphite-scop-detection.c (scop_detection::harmful_loop_in_region): Properly terminate dominator walk when crossing the exit edge not when visiting its source block. * gfortran.dg/graphite/pr83963.f: New testcase. * gcc.dg/graphite/pr83963-2.c: Likewise. From-SVN: r256973 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a1307e34b50..f3fb04f2be0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-01-23 Richard Biener + + PR tree-optimization/83963 + * graphite-scop-detection.c (scop_detection::harmful_loop_in_region): + Properly terminate dominator walk when crossing the exit edge not + when visiting its source block. + 2018-01-23 Jakub Jelinek PR c++/83918 diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 6f407e16c88..15559ae5ee6 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -677,10 +677,10 @@ scop_detection::harmful_loop_in_region (sese_l scop) const if (!stmt_simple_for_scop_p (scop, gsi_stmt (gsi), bb)) return true; - if (bb != exit_bb) - for (basic_block dom = first_dom_son (CDI_DOMINATORS, bb); - dom; - dom = next_dom_son (CDI_DOMINATORS, dom)) + for (basic_block dom = first_dom_son (CDI_DOMINATORS, bb); + dom; + dom = next_dom_son (CDI_DOMINATORS, dom)) + if (dom != scop.exit->dest) worklist.safe_push (dom); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d22af7ab927..760422aee58 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-01-23 Richard Biener + + PR tree-optimization/83963 + * gfortran.dg/graphite/pr83963.f: New testcase. + * gcc.dg/graphite/pr83963-2.c: Likewise. + 2018-01-23 Jakub Jelinek PR c++/83918 diff --git a/gcc/testsuite/gcc.dg/graphite/pr83963-2.c b/gcc/testsuite/gcc.dg/graphite/pr83963-2.c new file mode 100644 index 00000000000..56a279ce415 --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/pr83963-2.c @@ -0,0 +1,26 @@ +/* { dg-do compile } */ +/* { dg-options "-O -floop-nest-optimize" } */ + +int Chv_countBigEntries (int npivot, int pivotsizes[], int countflag, + double droptol, int nD) +{ + double absval ; + double *entries ; + int count; + int ii, jj, kinc, kk, kstart, stride ; + for ( ii = 0 ; ii < nD ; ii++ ) + { + kk = kstart ; + kinc = stride ; + for ( jj = 0 ; jj < ii ; jj++ ) + { + absval = __builtin_fabs(entries[kk]) ; + if ( absval >= droptol ) + count++ ; + kk += kinc ; + kinc -= 2 ; + } + kstart-- ; + } + return count; +} diff --git a/gcc/testsuite/gfortran.dg/graphite/pr83963.f b/gcc/testsuite/gfortran.dg/graphite/pr83963.f new file mode 100644 index 00000000000..4e6410244d8 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/graphite/pr83963.f @@ -0,0 +1,18 @@ +! { dg-do compile } +! { dg-options "-O -floop-nest-optimize" } + + SUBROUTINE DAVCI(NORB,NCOR,NCI,NA,NB, + * CI,MAXP,MAXW1, + * IHMCON,ISTRB,ISTRP,ISTAR,II) + DIMENSION EC(MAXP,MAXP),IWRK1(2*MAXW1) + EC(II,II) = 1.0D+00 + DO 1396 II=1,MAXP + DO 1398 JJ=1,II-1 + EC(II,JJ) = 0.0D+00 + 1398 CONTINUE + 1396 CONTINUE + IF (NA.EQ.NB) THEN + CALL RINAB0(SI1,SI2,NORB,NCOR,NCI,NA,NB,CI(1,IP),IACON1,IBCON1, + * IWRK1,IHMCON,ISTRB,ISTRP,ISTAR) + ENDIF + END