diff options
author | Bernd Schmidt <bernds@redhat.com> | 2002-02-04 19:19:04 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2002-02-04 19:19:04 +0000 |
commit | 24c545ff924c8a6a24f5b85f6352cac27bd18247 (patch) | |
tree | 743187c2f8fbf9702cbdcd69eea1b099cb421762 /gcc | |
parent | 72db02bfc38fb04a7d3a7f616ca7a6c6fad82859 (diff) | |
download | gcc-24c545ff924c8a6a24f5b85f6352cac27bd18247.zip gcc-24c545ff924c8a6a24f5b85f6352cac27bd18247.tar.gz gcc-24c545ff924c8a6a24f5b85f6352cac27bd18247.tar.bz2 |
cfgrtl.c (force_nonfallthru_and_redirect): Don't try to redirect the entry block.
* cfgrtl.c (force_nonfallthru_and_redirect): Don't try to redirect
the entry block.
From-SVN: r49488
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cfgrtl.c | 23 |
2 files changed, 27 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e55ca94..f80d9e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-02-04 Bernd Schmidt <bernds@redhat.com> + + * cfgrtl.c (force_nonfallthru_and_redirect): Don't try to redirect + the entry block. + 2002-02-04 Richard Henderson <rth@redhat.com> * combine.c (force_to_mode): Remove STACK_BIAS code. diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 9e8269b..42358b2 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -918,7 +918,28 @@ force_nonfallthru_and_redirect (e, target) abort (); else if (!(e->flags & EDGE_FALLTHRU)) abort (); - else if (e->src->succ->succ_next) + else if (e->src == ENTRY_BLOCK_PTR) + { + /* We can't redirect the entry block. Create an empty block at the + start of the function which we use to add the new jump. */ + edge *pe1; + basic_block bb = create_basic_block (0, e->dest->head, NULL); + + /* Change the existing edge's source to be the new block, and add + a new edge from the entry block to the new block. */ + e->src = bb; + for (pe1 = &ENTRY_BLOCK_PTR->succ; *pe1; pe1 = &(*pe1)->succ_next) + if (*pe1 == e) + { + *pe1 = e->succ_next; + break; + } + e->succ_next = 0; + bb->succ = e; + make_single_succ_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU); + } + + if (e->src->succ->succ_next) { /* Create the new structures. */ note = last_loop_beg_note (e->src->end); |