https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81766

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, it seems the CODE_LABEL in the first bb (successor of entry bb) is added by
ix86_init_large_pic_reg called by called by ix86_init_pic_reg from:
5135      /* Perform target specific PIC register initialization.  */
5136      targetm.init_pic_reg ();
in ira.
In particular, the seq including the CODE_LABEL is added to:
8887      entry_edge = single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun));
8888      insert_insn_on_edge (seq, entry_edge);
8889      commit_one_edge_insertion (entry_edge);
so I'd say this is a backend bug, it should have created the extra bb, or
called find_many_sub_basic_blocks (blocks); using a similar technique I've
added in r250815, because it doesn't really know where the edge insertion will
insert stuff.  I think we were just extremely lucky no other pass in between
ira and pro_and_epilogue was upset on the invalid RTL.
That said, for 7.2 my preference is above patch, and for 8.0 I think we should
fix the i386 backend (the only one that has targetm.init_pic_reg implemented).
This stuff is weird anyway, do we really need it at the beginning of the
function, even if we say shrink-wrap (i.e. shouldn't it be done in the
prologue)?

Reply via email to