Commit cd356d96 by Ulrich Weigand Committed by Ulrich Weigand

tree-ssa-ccp.c (optimize_unreachable): Check gsi_end_p before calling gsi_stmt.

	* tree-ssa-ccp.c (optimize_unreachable): Check gsi_end_p
	before calling gsi_stmt.

From-SVN: r189539
parent aaba3304
2012-07-16 Ulrich Weigand <ulrich.weigand@linaro.org>
* tree-ssa-ccp.c (optimize_unreachable): Check gsi_end_p
before calling gsi_stmt.
2012-07-16 Kirill Yukhin <kirill.yukhin@intel.com> 2012-07-16 Kirill Yukhin <kirill.yukhin@intel.com>
Revert Revert
......
...@@ -2355,9 +2355,11 @@ optimize_unreachable (gimple_stmt_iterator i) ...@@ -2355,9 +2355,11 @@ optimize_unreachable (gimple_stmt_iterator i)
FOR_EACH_EDGE (e, ei, bb->preds) FOR_EACH_EDGE (e, ei, bb->preds)
{ {
gsi = gsi_last_bb (e->src); gsi = gsi_last_bb (e->src);
stmt = gsi_stmt (gsi); if (gsi_end_p (gsi))
continue;
if (stmt && gimple_code (stmt) == GIMPLE_COND) stmt = gsi_stmt (gsi);
if (gimple_code (stmt) == GIMPLE_COND)
{ {
if (e->flags & EDGE_TRUE_VALUE) if (e->flags & EDGE_TRUE_VALUE)
gimple_cond_make_false (stmt); gimple_cond_make_false (stmt);
......
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