On Mon, Aug 12, 2024 at 4:25 AM Jakub Jelinek <ja...@redhat.com> wrote:
>
> On Mon, Aug 12, 2024 at 04:19:58AM -0700, H.J. Lu wrote:
> > > This is wrong.  As documented, BB_HEAD needs to be either a CODE_LABEL, or
> > > NOTE_INSN_BASIC_BLOCK.
> >
> > ira.cc has
> >
> >           new_insn = emit_insn_before (PATTERN (def_insn), use_insn);
> >           REG_NOTES (new_insn) = REG_NOTES (def_insn);
> >           REG_NOTES (def_insn) = 0;
> >           /* Rescan it to process the notes.  */
> >           df_insn_rescan (new_insn);
> >
> >           /* Make sure this insn is recognized before reload begins,
> >              otherwise eliminate_regs_in_insn will die.  */
> >           INSN_CODE (new_insn) = INSN_CODE (def_insn);
> >
> >           delete_insn (def_insn);
> >
> >           XEXP (reg_equiv[regno].init_insns, 0) = new_insn;
> >
> >           REG_BASIC_BLOCK (regno) = use_bb->index;
> >           REG_N_CALLS_CROSSED (regno) = 0;
> >
> >           if (use_insn == BB_HEAD (use_bb))
> >             BB_HEAD (use_bb) = new_insn;
> >
> > new_insn isn't CODE_LABEL nor NOTE_INSN_BASIC_BLOCK.
> > Should it be changed?
>
> Guess it depends if it survives that way until after the pass or not, if
> the pass can tolerate temporary violation, fine, if it survives to next
> passes, it is not.

I assume that the IRA code is triggered and works.

-- 
H.J.

Reply via email to