aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-split-paths.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-05-15 09:38:54 +0200
committerRichard Biener <rguenther@suse.de>2020-05-15 12:11:37 +0200
commitaaf1ee48316f9b414b11c17e298198925d816595 (patch)
treef34b7b85cb8c081b36a8a3a53b2055502c2a7074 /gcc/gimple-ssa-split-paths.c
parent62af27e77b5b985bd496d9bc9ed35233bd612b04 (diff)
downloadgcc-aaf1ee48316f9b414b11c17e298198925d816595.zip
gcc-aaf1ee48316f9b414b11c17e298198925d816595.tar.gz
gcc-aaf1ee48316f9b414b11c17e298198925d816595.tar.bz2
tree-optimization/95133 - avoid abnormal edges in path splitting
When path splitting tries to detect a CFG diamond make sure it is composed of normal (non-EH, not abnormal) edges. Otherwise CFG manipulation later may fail. 2020-05-15 Richard Biener <rguenther@suse.de> PR tree-optimization/95133 * gimple-ssa-split-paths.c (find_block_to_duplicate_for_splitting_paths): Check for normal edges. * gcc.dg/pr95133.c: New testcase.
Diffstat (limited to 'gcc/gimple-ssa-split-paths.c')
-rw-r--r--gcc/gimple-ssa-split-paths.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/gimple-ssa-split-paths.c b/gcc/gimple-ssa-split-paths.c
index 1a56868..b3efd43 100644
--- a/gcc/gimple-ssa-split-paths.c
+++ b/gcc/gimple-ssa-split-paths.c
@@ -67,8 +67,14 @@ find_block_to_duplicate_for_splitting_paths (basic_block latch)
region. Verify that it is.
First, verify that BB has two predecessors (each arm of the
- IF-THEN-ELSE) and two successors (the latch and exit). */
- if (EDGE_COUNT (bb->preds) == 2 && EDGE_COUNT (bb->succs) == 2)
+ IF-THEN-ELSE) and two successors (the latch and exit) and that
+ all edges are normal. */
+ if (EDGE_COUNT (bb->preds) == 2
+ && !(EDGE_PRED (bb, 0)->flags & EDGE_COMPLEX)
+ && !(EDGE_PRED (bb, 1)->flags & EDGE_COMPLEX)
+ && EDGE_COUNT (bb->succs) == 2
+ && !(EDGE_SUCC (bb, 0)->flags & EDGE_COMPLEX)
+ && !(EDGE_SUCC (bb, 1)->flags & EDGE_COMPLEX))
{
/* Now verify that BB's immediate dominator ends in a
conditional as well. */