On Fri, Oct 09, 2026 at 04:19:30PM +0200, Julius Bairaktaris wrote:
> @@ -3400,18 +3400,11 @@ mips16_gp_pseudo_reg (void)
>  {
>    if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX)
>      {
> -      rtx_insn *scan;
> -
>        cfun->machine->mips16_gp_pseudo_rtx = gen_reg_rtx (Pmode);
>  
> -      push_topmost_sequence ();
> -
> -      scan = get_insns ();
> -      while (NEXT_INSN (scan) && !INSN_P (NEXT_INSN (scan)))
> -     scan = NEXT_INSN (scan);
> -
> +      start_sequence ();
>        rtx set = gen_load_const_gp (cfun->machine->mips16_gp_pseudo_rtx);
> -      rtx_insn *insn = emit_insn_after (set, scan);
> +      rtx_insn *insn = emit_insn (set);
>        INSN_LOCATION (insn) = 0;
>        /* NewABI support hasn't been implement.  NewABI should generate RTL
>        sequence instead of ASM sequence directly.  */
> @@ -3420,6 +3413,13 @@ mips16_gp_pseudo_reg (void)
>         emit_clobber (MIPS16_PIC_TEMP);
>         emit_clobber (MIPS_PROLOGUE_TEMP (Pmode));
>       }
> +      rtx_insn *seq = end_sequence ();
> +
> +      /* Until construct_init_block, the topmost sequence is just the
> +      parameter setup, all of which goes into the init block.  */
> +      push_topmost_sequence ();
> +      emit_insn_after (seq, (ENTRY_BLOCK_PTR_FOR_FN (cfun)->flags & BB_RTL
> +                          ? entry_of_function () : get_insns ()));

Just emit it after entry_of_function () always.  I don't see how the backend
function could be invoked before contruct_init_block.

        Jakub

Reply via email to