diff options
author | Richard Biener <rguenther@suse.de> | 2016-11-08 08:03:54 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2016-11-08 08:03:54 +0000 |
commit | ed053eb8240556e7953ff865c428b784b6546717 (patch) | |
tree | fef6fa3dc72e0b5fddeac5364f9e7a495ebeb207 /gcc/tree-call-cdce.c | |
parent | 06658c6d05b360dfb85b173d67975603d5e960f3 (diff) | |
download | gcc-ed053eb8240556e7953ff865c428b784b6546717.zip gcc-ed053eb8240556e7953ff865c428b784b6546717.tar.gz gcc-ed053eb8240556e7953ff865c428b784b6546717.tar.bz2 |
re PR tree-optimization/78224 (g++ ICE at -O2(-O1 on gcc6) and above in verify_loop_structure, at cfgloop.c:1646)
2016-11-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/78224
* tree-call-cdce.c (shrink_wrap_one_built_in_call_with_conds):
Split the fallthru edge in case its successor may have PHIs.
Do not free dominance info.
* g++.dg/torture/pr78224.C: New testcase.
From-SVN: r241955
Diffstat (limited to 'gcc/tree-call-cdce.c')
-rw-r--r-- | gcc/tree-call-cdce.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index 8df9b08..861834d 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -807,15 +807,20 @@ shrink_wrap_one_built_in_call_with_conds (gcall *bi_call, vec <gimple *> conds, can_guard_call_p. */ join_tgt_in_edge_from_call = find_fallthru_edge (bi_call_bb->succs); gcc_assert (join_tgt_in_edge_from_call); - free_dominance_info (CDI_DOMINATORS); + /* We don't want to handle PHIs. */ + if (EDGE_COUNT (join_tgt_in_edge_from_call->dest->preds) > 1) + join_tgt_bb = split_edge (join_tgt_in_edge_from_call); + else + join_tgt_bb = join_tgt_in_edge_from_call->dest; } else - join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call); + { + join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call); + join_tgt_bb = join_tgt_in_edge_from_call->dest; + } bi_call_bsi = gsi_for_stmt (bi_call); - join_tgt_bb = join_tgt_in_edge_from_call->dest; - /* Now it is time to insert the first conditional expression into bi_call_bb and split this bb so that bi_call is shrink-wrapped. */ |