https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65803
--- Comment #4 from Chen Gang <gang.chen.5i5j at gmail dot com> --- Reference to gccint.pdf Page 268 for jump_isn, we know that JUMP_LABLE() must be defined after optimization completed. In our case, we are just doing optimization, and is almost finished, so we need set JUMP_LABLE() after emit jump_insn. The related diff is bellow: diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index dc24ed5..0297b59 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -3777,7 +3777,10 @@ hwloop_optimize (hwloop_info loop) } else { - emit_jump_insn (gen_jump (label)); + rtx_insn * ret = emit_jump_insn (gen_jump (label)); + + JUMP_LABEL(ret) = label; + LABEL_NUSES (label)++; seq_end = emit_barrier (); } }