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); }