diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d35f141f7e07..00272783344b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 6 17:23:41 1998 Jim Wilson + + * haifa-sched.c (build_control_flow): Set unreachable for block whose + only predecessor is itself. + Mon Apr 6 16:08:04 1998 Kaveh R. Ghazi * c-parse.in: Include system.h, and remove stuff now made redundant. diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 43e5264d0848..9b7c0d4744d0 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; }