]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
target/110220: Set JUMP_LABEL and LABEL_NUSES of new branch insn generated by
authorGeorg-Johann Lay <avr@gjlay.de>
Tue, 1 Aug 2023 11:49:17 +0000 (13:49 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Tue, 1 Aug 2023 11:50:50 +0000 (13:50 +0200)
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.

gcc/config/avr/avr.cc

index 0447641a8e97dcbd0f0d5ed158396a58a2fa6107..25f3f4c22e08ca3aa5645ef971ec35ccfaaf8824 100644 (file)
@@ -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();