Anton Youdkevitch <anton.youdkevi...@bell-sw.com> writes: > Folks, > > I'm trying to deal with CFG construction at RTL level and I bumped into a > problem > when I created a jump to a certain label. After the jump is created I try > to extract the > label using JUMP_LABEL but I get nothing. > > The code looks like like this: > > begin_sequence (); > code_label lab = gen_label_rtx () > rtx x = gen_rtx_GT (...); > x = gen_rtx_IF_THEN_ELSE (VOIDmode, x, gen_rtx_LABEL_REF (Pmode, lab)); > rtx_insn *j = emit_jump_insn (gen_rtx_SET (x)); > end_sequence (); > > rtx lab1 = JUMP_LABEL (j) // <--- I get NULL here > > What am I missing?
JUMP_LABEL is normally set up later, see the rebuild_jump_labels call in pass_expand::execute. You can force it to happen “early” for new sequences by using rebuild_jump_labels_chain. Thanks, Richard