From: Tom de Vries Date: Mon, 11 Jan 2016 09:19:33 +0000 (+0000) Subject: Handle case that outer phi res is not used in a phi in gather_scalar_reductions X-Git-Tag: basepoints/gcc-7~1741 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f6403a8ce2648cb785789f444b5bbaccd415976;p=thirdparty%2Fgcc.git Handle case that outer phi res is not used in a phi in gather_scalar_reductions 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. * gcc.dg/autopar/pr69108.c: New test. From-SVN: r232211 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 29e45a62e42b..43623dcd9704 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 615a527e1ce3..ec4cd37f0004 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 000000000000..39fc07e96f54 --- /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 e05cc4746d71..d68370430c26 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))