diff mbox

config/bfin/bfin.c (hwloop_optimize): Set JUMP_LABEL() after emit jump_insn

Message ID BLU436-SMTP25704AE6F289D515FE3324AB9A30@phx.gbl
State New
Headers show

Commit Message

Chen Gang June 20, 2015, 10:48 a.m. UTC
JUMP_LABLE() must be defined after optimization completed. In this case,
it is doing optimization, and is almost finished, so it is no chances to
set JUMP_LABLE() next. The related issue is Bug 65803.

2015-06-20  Chen Gang  <gang.chen.5i5j@gmail.com>

	* config/bfin/bfin.c (hwloop_optimize): Set JUMP_LABEL() after
	emit jump_insn.
---
 gcc/config/bfin/bfin.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c
index 3b4b54e..23c2d51 100644
--- a/gcc/config/bfin/bfin.c
+++ b/gcc/config/bfin/bfin.c
@@ -3775,7 +3775,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 ();
 	}
     }