On Fri, Oct 09, 2026 at 05:01:00PM +0200, Jakub Jelinek wrote:
> 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.

There is a second caller before construct_init_block, expand_phi_nodes:

  mips16_gp_pseudo_reg
  ...
  insert_value_copy_on_edge
  eliminate_phi
  expand_phi_nodes   <- pass_expand::execute

There the current sequence is the copy sequence of one PHI edge, so
with emit_insn (seq) the $gp load is only done on that edge.

I tried your version: in gcc.c-torture/execute/20021015-1.c main then
loads g_list through $gp before $gp is set, and 179 execution results
fail with -mips16 -fpic that pass on master and with v2.

So I'd keep get_insns () for that case.  Should I mention
expand_phi_nodes in the comment?

Julius

Reply via email to