summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-11 09:19:33 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-11 09:19:33 +0000
commitc4157ee5376afc71e1ab06ab719a524a518a6c14 (patch)
treee7c44fcd28db1db33aadb1e8f45b1be58a95b673
parent4589a8011071beb19f184e02ef3f7c19e93db288 (diff)
downloadgcc-c4157ee5376afc71e1ab06ab719a524a518a6c14.tar.gz
Handle case that outer phi res is not used in a phi in gather_scalar_reductions
2016-01-11 Tom de Vries <tom@codesourcery.com> PR tree-optimization/69108 * tree-parloops.c (gather_scalar_reductions): Handle case that outer phi res is not used in a phi. * gcc.dg/autopar/pr69108.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@232211 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/autopar/pr69108.c4
-rw-r--r--gcc/tree-parloops.c2
4 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 29e45a62e42..43623dcd970 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-11 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/69108
+ * tree-parloops.c (gather_scalar_reductions): Handle case that outer phi
+ res is not used in a phi.
+
2016-01-11 Yury Gribov <y.gribov@samsung.com>
PR 67425
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 615a527e1ce..ec4cd37f000 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-11 Tom de Vries <tom@codesourcery.com>
+
+ PR tree-optimization/69108
+ * gcc.dg/autopar/pr69108.c: New test.
+
2016-01-10 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/69029
diff --git a/gcc/testsuite/gcc.dg/autopar/pr69108.c b/gcc/testsuite/gcc.dg/autopar/pr69108.c
new file mode 100644
index 00000000000..39fc07e96f5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/autopar/pr69108.c
@@ -0,0 +1,4 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2" } */
+
+#include "../graphite/interchange-2.c"
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index e05cc4746d7..d68370430c2 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -2474,6 +2474,8 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
gimple *inner_stmt;
bool single_use_p = single_imm_use (res, &use_p, &inner_stmt);
gcc_assert (single_use_p);
+ if (gimple_code (inner_stmt) != GIMPLE_PHI)
+ continue;
gphi *inner_phi = as_a <gphi *> (inner_stmt);
if (simple_iv (loop->inner, loop->inner, PHI_RESULT (inner_phi),
&iv, true))