aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAditya Kumar <aditya.k7@samsung.com>2015-11-19 23:06:18 +0000
committerSebastian Pop <spop@gcc.gnu.org>2015-11-19 23:06:18 +0000
commita378e92255a31d26d0905e72de1abd91a161f758 (patch)
tree1c5ffeb4a3d32dabd1282ae7c55fc1f8eadd0719 /gcc
parent2927ca4b24666f947b0c91c42fabc41a98593a3a (diff)
downloadgcc-a378e92255a31d26d0905e72de1abd91a161f758.zip
gcc-a378e92255a31d26d0905e72de1abd91a161f758.tar.gz
gcc-a378e92255a31d26d0905e72de1abd91a161f758.tar.bz2
fix PR68428: ignore bb dominated by the scop->exit
Co-Authored-By: Sebastian Pop <s.pop@samsung.com> From-SVN: r230632
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/graphite-scop-detection.c6
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr68428.c23
4 files changed, 41 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4b8bd47..949e12e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,13 @@
2015-11-19 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
+ PR tree-optimization/68428
+ * graphite-scop-detection.c (harmful_stmt_in_region): Do not iterate
+ over basic blocks outside the scop.
+
+2015-11-19 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
PR tree-optimization/68341
* graphite-isl-ast-to-gimple.c (get_rename_from_scev): Remove
gcc_unreachable and safely fail codegen.
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index e42b9bf..84fe945 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -1062,12 +1062,16 @@ scop_detection::harmful_stmt_in_region (sese_l scop) const
basic_block bb;
FOR_EACH_VEC_ELT (dom, i, bb)
{
- DEBUG_PRINT (dp << "\nVisiting bb_" << bb->index);
+ DEBUG_PRINT (dp << "Visiting bb_" << bb->index << "\n");
/* We don't want to analyze any bb outside sese. */
if (!dominated_by_p (CDI_POST_DOMINATORS, bb, exit_bb))
continue;
+ /* Basic blocks dominated by the scop->exit are not in the scop. */
+ if (bb != exit_bb && dominated_by_p (CDI_DOMINATORS, bb, exit_bb))
+ continue;
+
/* The basic block should not be part of an irreducible loop. */
if (bb->flags & BB_IRREDUCIBLE_LOOP)
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1290aa0..f107483 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,6 +1,12 @@
2015-11-19 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>
+ PR tree-optimization/68428
+ * gcc.dg/graphite/pr68428.c: New.
+
+2015-11-19 Aditya Kumar <aditya.k7@samsung.com>
+ Sebastian Pop <s.pop@samsung.com>
+
PR tree-optimization/68335
* gfortran.dg/graphite/pr68335.f90: New.
diff --git a/gcc/testsuite/gcc.dg/graphite/pr68428.c b/gcc/testsuite/gcc.dg/graphite/pr68428.c
new file mode 100644
index 0000000..2dc63b7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr68428.c
@@ -0,0 +1,23 @@
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+int au[4] = { 0 };
+
+int
+main(void)
+{
+ int dc;
+ int m7;
+ int lv;
+ int f2;
+ int uq[3] = { 1 };
+ for (dc = 0; dc < 2; ++dc) {
+ for (lv = 0; lv < 2; ++lv)
+ for (m7 = 0; m7 < 3; ++m7) {
+ if (uq[dc] == 0)
+ continue;
+ for (f2 = 0; f2 < 3; ++f2)
+ au[dc+2] = uq[f2];
+ }
+ }
+ return 0;
+}