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.

From-SVN: r232211
This commit is contained in:
Tom de Vries 2016-01-11 09:19:33 +00:00 committed by Tom de Vries
parent 4bfede854f
commit 4f6403a8ce
4 changed files with 17 additions and 0 deletions

View File

@ -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> 2016-01-11 Yury Gribov <y.gribov@samsung.com>
PR 67425 PR 67425

View File

@ -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> 2016-01-10 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/69029 PR c++/69029

View File

@ -0,0 +1,4 @@
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-parallelize-loops=2" } */
#include "../graphite/interchange-2.c"

View File

@ -2474,6 +2474,8 @@ gather_scalar_reductions (loop_p loop, reduction_info_table_type *reduction_list
gimple *inner_stmt; gimple *inner_stmt;
bool single_use_p = single_imm_use (res, &use_p, &inner_stmt); bool single_use_p = single_imm_use (res, &use_p, &inner_stmt);
gcc_assert (single_use_p); gcc_assert (single_use_p);
if (gimple_code (inner_stmt) != GIMPLE_PHI)
continue;
gphi *inner_phi = as_a <gphi *> (inner_stmt); gphi *inner_phi = as_a <gphi *> (inner_stmt);
if (simple_iv (loop->inner, loop->inner, PHI_RESULT (inner_phi), if (simple_iv (loop->inner, loop->inner, PHI_RESULT (inner_phi),
&iv, true)) &iv, true))