Committed as obvious. An insn emitted by avr specific RTL optimization pass missed setting of its JUMP_LABEL.

Johann

target/110220: Set JUMP_LABEL and LABEL_NUSES of new branch insn generated by
    target specific RTL optimization pass .avr-casesi.

    gcc/
            PR target/110220
            * config/avr/avr.cc (avr_optimize_casesi): Set JUMP_LABEL and
            LABEL_NUSES of new conditional branch instruction.

diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 0447641a8e9..25f3f4c22e0 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -644,9 +644,11 @@ avr_optimize_casesi (rtx_insn *insns[5], rtx *xop)
   emit_insn (gen_add (reg, reg, gen_int_mode (-low_idx, mode)));
   rtx op0 = reg; rtx op1 = gen_int_mode (num_idx, mode);
   rtx labelref = copy_rtx (xop[4]);
-  emit_jump_insn (gen_cbranch (gen_rtx_fmt_ee (GTU, VOIDmode, op0, op1),
-                               op0, op1,
-                               labelref));
+  rtx xbranch = gen_cbranch (gen_rtx_fmt_ee (GTU, VOIDmode, op0, op1),
+                            op0, op1, labelref);
+  rtx_insn *cbranch = emit_jump_insn (xbranch);
+  JUMP_LABEL (cbranch) = xop[4];
+  ++LABEL_NUSES (xop[4]);

   seq1 = get_insns();
   last1 = get_last_insn();

Reply via email to