Hi, On Mon, 18 Apr 2016, Andrew Haley wrote:
> On 04/15/2016 06:29 PM, Alexander Monakov wrote: > > > Alternatively: replace first nop with a short forward branch that > > jumps over the rest of the pad, patch rest of the pad, patch the > > initial forward branch. > > That may not be safe. Consider an implementation which looks ahead in > the instruction stream and decodes the instructions speculatively. It should go without saying that patching instructions is followed by whatever means necessary to flush any such caches on a particular implementation (here after patching the jump, after patching the rest, and after patching the first insn again, i.e. three times). Nothing that GCC needs to worry about, but the patching infrastructure. Ciao, Michael.