summaryrefslogtreecommitdiff
path: root/gcc/bb-reorder.c
diff options
context:
space:
mode:
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-09 03:57:19 +0000
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-09 03:57:19 +0000
commitd3a06cc532e98999f1663a9e50f8b83868134839 (patch)
tree92c30a93ee2301b6249676d7703cf0c1b1f955cc /gcc/bb-reorder.c
parentd29932c981606d703a7bfeaadff9a1c0ed21af63 (diff)
downloadgcc-d3a06cc532e98999f1663a9e50f8b83868134839.tar.gz
Fix bb-reorder problem with degenerate cond_jump (PR68182)
The code mistakenly thinks any cond_jump has two successors. This is not true if both destinations are the same, as can happen with weird patterns as in the PR. PR rtl-optimization/68182 * gcc/bb-reorder.c (reorder_basic_blocks_simple): Treat a conditional branch with only one successor just like unconditional branches. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/bb-reorder.c')
-rw-r--r--gcc/bb-reorder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 5f1c2ccc6cb..950b1a1089d 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -2304,7 +2304,9 @@ reorder_basic_blocks_simple (void)
if (JUMP_P (end) && extract_asm_operands (end))
continue;
- if (any_condjump_p (end))
+ if (single_succ_p (bb))
+ edges[n++] = EDGE_SUCC (bb, 0);
+ else if (any_condjump_p (end))
{
edge e0 = EDGE_SUCC (bb, 0);
edge e1 = EDGE_SUCC (bb, 1);
@@ -2315,8 +2317,6 @@ reorder_basic_blocks_simple (void)
edges[n++] = e0;
edges[n++] = e1;
}
- else if (single_succ_p (bb))
- edges[n++] = EDGE_SUCC (bb, 0);
}
/* Sort the edges, the most desirable first. When optimizing for size