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 + + 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 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 + + PR tree-optimization/69108 + * gcc.dg/autopar/pr69108.c: New test. + 2016-01-10 Patrick Palka 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 (inner_stmt); if (simple_iv (loop->inner, loop->inner, PHI_RESULT (inner_phi), &iv, true))