diff options
author | Ulrich Weigand <ulrich.weigand@linaro.org> | 2012-07-16 14:27:53 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2012-07-16 14:27:53 +0000 |
commit | cd356d96737789078f5fc9502c940c0ce7dbd112 (patch) | |
tree | a9b04d5699adbb5b09331d384183ac00cea3acf5 /gcc/tree-ssa-ccp.c | |
parent | aaba3304b2a43b12dd31b7b583cc87b038c52f9e (diff) | |
download | gcc-cd356d96737789078f5fc9502c940c0ce7dbd112.zip gcc-cd356d96737789078f5fc9502c940c0ce7dbd112.tar.gz gcc-cd356d96737789078f5fc9502c940c0ce7dbd112.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index d2ce870..6dc30e1 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2355,9 +2355,11 @@ optimize_unreachable (gimple_stmt_iterator i) FOR_EACH_EDGE (e, ei, bb->preds) { 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) gimple_cond_make_false (stmt); |