This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/66620] bfin: bfin.c: (hwloop_optimize): gcc_assert (JUMP_P (insn)) fails.
- From: "gang.chen.5i5j at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 28 Jun 2015 13:54:51 +0000
- Subject: [Bug target/66620] bfin: bfin.c: (hwloop_optimize): gcc_assert (JUMP_P (insn)) fails.
- Auto-submitted: auto-generated
- References: <bug-66620-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66620
--- Comment #9 from Chen Gang <gang.chen.5i5j at gmail dot com> ---
After check the assembly result for the without "-fno-reorder-block", it is OK.
It is for lsetup optimization.
And for having "-fno-reorder-block", the insns are also correct, and after skip
the related assert(), it can also pass compiling and generate the correct
assembly code.
The related diff is below, and the related assembly code is in the next
attachment.
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);
}