On Fri, Oct 2, 2015 at 3:14 AM, Segher Boessenkool <seg...@kernel.crashing.org> wrote: > On Fri, Oct 02, 2015 at 10:24:07AM +0930, Alan Modra wrote: >> On Thu, Oct 01, 2015 at 12:18:08PM -0500, Segher Boessenkool wrote: >> > On Thu, Oct 01, 2015 at 12:14:44PM +0200, Richard Biener wrote: >> > > So even if not "easy", can you try? >> > >> > I did, and after half a day had a big mess and lots of things failing, >> > no idea where this was headed, and in the meantime bootstrap still fails >> > (on affected targets). >> >> I had a look too, and while you can revise the load_toc_v4_PIC >> patterns to use labels emitted the usual way (eg. as in >> i386.c:ix86_init_large_pic_reg) they tend to wander away from the >> insn. > > Yes, and only "bcl 20,31,$+4" avoids the link stack on recent CPUs > (bcl 20,31,$+8, which we also use, doesn't). > >> I think that could be solved, but these labels which aren't >> referred to by jump insns get converted to NOTE_INSN_DELETED_LABEL >> somewhere, and that leads to further pain. > > Yes. You need to make the bcl a jump_insn to the label. And then > there is yet more pain.
Sounds like supporting this with a special instruction in the assembler would be easier then? ... As for the compile-time hit, yes, calling the hook at all and having an extra loop over all stmts in cfg_layout_can_duplicate_bb_p. There are not many other uses of the hook, so I wonder if it is called everywhere it has to be called. Richard. > > Segher