aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@gcc.gnu.org>2015-11-09 04:57:19 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2015-11-09 04:57:19 +0100
commitd4c8d5ede1f35643163942af46bcb51d3c03c8d7 (patch)
tree92c30a93ee2301b6249676d7703cf0c1b1f955cc
parent4f70cb39c0032dee5caf7b0851556959649895ff (diff)
downloadgcc-d4c8d5ede1f35643163942af46bcb51d3c03c8d7.zip
gcc-d4c8d5ede1f35643163942af46bcb51d3c03c8d7.tar.gz
gcc-d4c8d5ede1f35643163942af46bcb51d3c03c8d7.tar.bz2
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. From-SVN: r229983
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/bb-reorder.c6
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6401c43..dcb6d55 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,10 @@
-2015-11-08 Jeff Law <jeff@redhat.com>
+2015-11-09 Segher Boessenkool <segher@kernel.crashing.org>
+
+ PR rtl-optimization/68182
+ * gcc/bb-reorder.c (reorder_basic_blocks_simple): Treat a conditional
+ branch with only one successor just like unconditional branches.
+
+2015-11-08 Jeff Law <jeff@redhat.com>
* tree-ssa-threadupdate.c (register_jump_thraed): Assert that a
non-FSM path has no edges marked with EDGE_DFS_BACK.
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index 5f1c2cc..950b1a1 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