re PR tree-optimization/84399 ([graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gimple.c:206)

2018-02-16  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84399
	* graphite-scop-detection.c (scop_detection::stmt_simple_for_scop_p):
	For operands we can analyze at their definition make sure we can
	analyze them at each use as well.

	* gcc.dg/graphite/pr84399.c: New testcase.

From-SVN: r257723
This commit is contained in:
Richard Biener 2018-02-16 08:16:17 +00:00 committed by Richard Biener
parent bd74f4d876
commit 4cf55739fd
4 changed files with 52 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2018-02-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/84399
* graphite-scop-detection.c (scop_detection::stmt_simple_for_scop_p):
For operands we can analyze at their definition make sure we can
analyze them at each use as well.
2018-02-16 Richard Biener <rguenther@suse.de> 2018-02-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/84190 PR tree-optimization/84190

View File

@ -1027,7 +1027,23 @@ scop_detection::stmt_simple_for_scop_p (sese_l scop, gimple *stmt,
case GIMPLE_ASSIGN: case GIMPLE_ASSIGN:
case GIMPLE_CALL: case GIMPLE_CALL:
{
tree op;
ssa_op_iter i;
/* Verify that if we can analyze operands at their def site we
also can represent them when analyzed at their uses. */
FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_USE)
if (scev_analyzable_p (op, scop)
&& !graphite_can_represent_expr (scop, bb->loop_father, op))
{
DEBUG_PRINT (dp << "[scop-detection-fail] "
<< "Graphite cannot represent stmt:\n";
print_gimple_stmt (dump_file, stmt, 0,
TDF_VOPS | TDF_MEMSYMS));
return false;
}
return true; return true;
}
default: default:
/* These nodes cut a new scope. */ /* These nodes cut a new scope. */

View File

@ -1,3 +1,8 @@
2018-02-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/84399
* gcc.dg/graphite/pr84399.c: New testcase.
2018-02-16 Richard Biener <rguenther@suse.de> 2018-02-16 Richard Biener <rguenther@suse.de>
PR tree-optimization/84190 PR tree-optimization/84190

View File

@ -0,0 +1,23 @@
/* { dg-do compile } */
/* { dg-options "-O2 -floop-nest-optimize -fno-tree-loop-im --param scev-max-expr-size=1" } */
void
h8 (int cv, int od)
{
for (;;)
{
int ih = (__UINTPTR_TYPE__)&od;
if (cv == 0)
while (od < 1)
{
int lq;
for (lq = 0; lq < 3; ++lq)
for (ih = 0; ih < 4; ++ih)
od += lq;
}
while (ih < 1)
{
}
}
}