aboutsummaryrefslogtreecommitdiff
path: root/gcc/haifa-sched.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-04-06 17:50:13 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-04-06 10:50:13 -0700
commita8afd67b0172b66bb0c08d798054eb409adce196 (patch)
tree0f7ad6186fa4f88868060b2e61cebcb3eeb9d421 /gcc/haifa-sched.c
parent944fc8abefc438b7087db07cdf81c1bbcb0faf26 (diff)
downloadgcc-a8afd67b0172b66bb0c08d798054eb409adce196.zip
gcc-a8afd67b0172b66bb0c08d798054eb409adce196.tar.gz
gcc-a8afd67b0172b66bb0c08d798054eb409adce196.tar.bz2
Fix solaris2 loop-2d.c failure reported by Manfred Hollstein.
* haifa-sched.c (build_control_flow): Set unreachable for block whose only predecessor is itself. From-SVN: r19021
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r--gcc/haifa-sched.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index 43e5264..9b7c0d4 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -1220,7 +1220,10 @@ build_control_flow ()
for (i = 0; i < n_basic_blocks; i++)
{
nr_edges += num_succs[i];
- if (num_preds[i] == 0)
+ /* ??? We must also detect unreachable loops here. We only handle the
+ trivial case of a loop with one basic block for now. */
+ if (num_preds[i] == 0
+ || (num_preds[i] == 1 && INT_LIST_VAL (s_preds[i]) == i))
unreachable = 1;
}