On Fri, Oct 09, 2026 at 02:41:10PM +0000, Julius Bairaktaris wrote:
> On Fri, Oct 09, 2026 at 04:25:30PM +0200, Jakub Jelinek wrote:
> > Just emit it after entry_of_function () always. I don't see how the backend
> > function could be invoked before contruct_init_block.
>
> It is, when parameter setup needs a libcall. In
> gcc.c-torture/execute/930603-1.c with -mips16 -mabicalls -fpic the K&R
> float parameter is converted with __mips16_truncdfsf2:
>
> mips16_gp_pseudo_reg
> ...
> convert_to_mode
> assign_parm_setup_reg
> assign_parms
> expand_function_start <- pass_expand::execute, before construct_init_block
Ugh.
But, if construct_init_block hasn't been called yet, then there is
no point to push it somewhere earlier in the sequence that will be pushed
into the init block, you can emit it at the current sequence without
push_topmost_sequence.
So, perhaps
if ((ENTRY_BLOCK_PTR_FOR_FN (cfun)->flags & BB_RTL) != 0)
{
push_topmost_sequence ();
emit_insn_after (seq, entry_of_function ());
pop_topmost_sequence ();
}
else
emit_insn (seq);
with suitable comment?
Jakub