Commit d32bc875 by Richard Biener

re PR tree-optimization/82672 ([GRAPHITE] ICE in verify_gimple_in_cfg)

2017-10-23  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/82672
	* graphite-isl-ast-to-gimple.c (graphite_copy_stmts_from_block):
	Fold the stmt if we propagated into it.

	* gfortran.dg/graphite/pr82672.f90: New testcase.

From-SVN: r254036
parent 57f6a200
...@@ -1175,6 +1175,8 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, ...@@ -1175,6 +1175,8 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
ssa_op_iter iter; ssa_op_iter iter;
use_operand_p use_p; use_operand_p use_p;
if (!is_gimple_debug (copy)) if (!is_gimple_debug (copy))
{
bool changed = false;
FOR_EACH_SSA_USE_OPERAND (use_p, copy, iter, SSA_OP_USE) FOR_EACH_SSA_USE_OPERAND (use_p, copy, iter, SSA_OP_USE)
{ {
tree old_name = USE_FROM_PTR (use_p); tree old_name = USE_FROM_PTR (use_p);
...@@ -1190,6 +1192,10 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb, ...@@ -1190,6 +1192,10 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
if (! codegen_error_p ()) if (! codegen_error_p ())
gsi_insert_earliest (stmts); gsi_insert_earliest (stmts);
replace_exp (use_p, new_name); replace_exp (use_p, new_name);
changed = true;
}
if (changed)
fold_stmt_inplace (&gsi_tgt);
} }
update_stmt (copy); update_stmt (copy);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment