This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] config/bfin/bfin.c (hwloop_optimize): Use return false instead of gcc_assert for checking jump_insn.
- From: Chen Gang <xili_gchen_5257 at hotmail dot com>
- To: Jeff Law <law at redhat dot com>, Richard Henderson <rth at redhat dot com>, Bernd Schmidt <bernds at codesourcery dot com>, jzhang918 at gmail dot com
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 28 Jun 2015 22:15:47 +0800
- Subject: [PATCH] config/bfin/bfin.c (hwloop_optimize): Use return false instead of gcc_assert for checking jump_insn.
- Authentication-results: sourceware.org; auth=none
For bfin looping optimization, after lsetup optimization, it can have
the correct lsetup related insns which causes gcc_assert for jump_insn.
The related bug is Bug 66620.
2015-06-28 Chen Gang <gang.chen.5i5j@gmail.com>
* config/bfin/bfin.c (hwloop_optimize): Use return false instead
of gcc_assert for checking jump_insn.
---
gcc/config/bfin/bfin.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 3b4b54e..91866dd 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -3520,7 +3520,13 @@ hwloop_optimize (hwloop_info loop)
if (vec_safe_length (loop->incoming) > 1
|| !(loop->incoming->last ()->flags & EDGE_FALLTHRU))
{
- gcc_assert (JUMP_P (insn));
+ if (!JUMP_P (insn))
+ {
+ if (dump_file)
+ fprintf (dump_file, ";; loop %d lsetup may already inserted\n",
+ loop->loop_no);
+ return false;
+ }
insn = PREV_INSN (insn);
}
--
1.9.3