diff options
| author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-16 11:03:23 +0000 |
|---|---|---|
| committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-16 11:03:23 +0000 |
| commit | d4cae31e732f51391c2b50e03828e2466db06a2d (patch) | |
| tree | aa35d729ddb84983b0e5f26d6811ef6dd5033f5a | |
| parent | cfef164f570aedabd654c02a1e322af37622406f (diff) | |
| download | ppe42-gcc-d4cae31e732f51391c2b50e03828e2466db06a2d.tar.gz ppe42-gcc-d4cae31e732f51391c2b50e03828e2466db06a2d.zip | |
* config/bfin/bfin.c (bfin_discover_loops): Delete empty loops.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135414 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 2 | ||||
| -rw-r--r-- | gcc/config/bfin/bfin.c | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e0c5c354964..5cd0d1fa52e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,7 @@ 2008-05-16 Bernd Schmidt <bernd.schmidt@analog.com> + * config/bfin/bfin.c (bfin_discover_loops): Delete empty loops. + From Jie Zhang <jie.zhang@analog.com> * config/bfin/t-bfin-elf (MULTILIB_OPTIONS, MULTILIB_DIRNAMES, MULTILIB_MATCHES, MULTILIB_EXCEPTIONS): Remove mcpu=bf532-0.3, diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index d24570f707e..d6506b6e09b 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -4218,8 +4218,23 @@ bfin_discover_loops (bitmap_obstack *stack, FILE *dump_file) if (INSN_P (tail) && recog_memoized (tail) == CODE_FOR_loop_end) { + rtx insn; /* A possible loop end */ + /* There's a degenerate case we can handle - an empty loop consisting + of only a back branch. Handle that by deleting the branch. */ + insn = BB_HEAD (BRANCH_EDGE (bb)->dest); + if (next_real_insn (insn) == tail) + { + if (dump_file) + { + fprintf (dump_file, ";; degenerate loop ending at\n"); + print_rtl_single (dump_file, tail); + } + delete_insn_and_edges (tail); + continue; + } + loop = XNEW (struct loop_info); loop->next = loops; loops = loop; |

