From e7c6abad7f0bcbf0e60d27bc8cff1087c5195f76 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 10 Jan 2018 21:39:20 +0000 Subject: re PR middle-end/81897 (spurious -Wmaybe-uninitialized warning) PR middle-end/81897 * tree-ssa-uninit.c (convert_control_dep_chain_into_preds): Skip empty blocks. From-SVN: r256456 --- gcc/tree-ssa-uninit.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/tree-ssa-uninit.c') diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index 3823947..8ccbc85 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -669,9 +669,16 @@ convert_control_dep_chain_into_preds (vec *dep_chains, e = one_cd_chain[j]; guard_bb = e->src; gsi = gsi_last_bb (guard_bb); - /* Ignore empty BBs as they're basically forwarder blocks. */ + /* Ignore empty forwarder blocks. */ if (empty_block_p (guard_bb) && single_succ_p (guard_bb)) continue; + /* An empty basic block here is likely a PHI, and is not one + of the cases we handle below. */ + if (gsi_end_p (gsi)) + { + has_valid_pred = false; + break; + } cond_stmt = gsi_stmt (gsi); if (is_gimple_call (cond_stmt) && EDGE_COUNT (e->src->succs) >= 2) /* Ignore EH edge. Can add assertion on the other edge's flag. */ -- cgit v1.1