On 01/03/17 11:26, Torsten Duwe wrote: > On Fri, Feb 17, 2017 at 11:30:29PM -0700, Sandra Loosemore wrote: >>> >>> +@item prolog_pad >>> +@cindex @code{prolog_pad} function attribute >> >> I'm only a documentation maintainer so this is out of my area of >> responsibility, but I really wish we could rename the attribute and >> command-line option. Per >> >> per https://gcc.gnu.org/codingconventions.html#Spelling >> >> the correct spelling is "prologue". >> >>> +@cindex extra NOP instructions at the function entry point >>> +In case the target's text segment can be made writable at run time >>> +by any means, padding the function entry with a number of NOPs can >>> +be used to provide a universal tool for instrumentation. Usually, >>> +prolog padding is enabled globally using the @option{-fprolog-pad=N,M} >> >> definitely s/prolog/prologue/ in the running text here. > > Well, you're definitely right in both cases. > > About 400 occurrences of "prolog" in the source without ChangeLogs, > mainly in gcc/tree-vect-loop-manip.c and in libgcc/config/libbid/bid_conf.h; > about 3000 lines with "prologue". However there is a "-mprolog-function" > switch. One might call this a broken window. I don't want to contribute > to that. > > However, writing some more documentation and being asked for clarity, > I found it more depicting to talk about the function entry point than > about the prologue. Also, this is about generic instrumentation, and it > surely involves NOPs. > > So, hereby I'd like to start a small poll for a good name for this feature. > Anyone with a better idea please speak up now. Otherwise I'll just > s/prolog/prologue/g.
Hmm, I'd prefer the bike shed to be green :-) How about --fpatchable-function-entry=<size-spec>? > >> The amount of space reserved is expressed as the number of NOP instructions >> to insert. On targets that have multiple instruction sizes, typically the >> smallest NOP instruction available for the current CPU mode is used to >> achieve the finest granularity. > > I've made another improvement which makes the code even more robust now. > +DEF_TARGET_INSN (nop, (void)) > In gcc/target-insns.def. This way I can easily check whether there is a > (define_insn "nop" ...) in the target md. Currently, all CPUs have it, but > who knows. The mid-end already has direct calls to gen_nop with no guards on the pattern existing, So the compiler won't build without a NOP pattern. > > This will also be the default instruction used (It can be overridden > in the terget hook), so that rule has changed. > > So, before the next version, any clever name suggestions? > > Torsten > R.