Hello Richard,
On Tue, 4 Jul 2017, Richard Earnshaw (lists) wrote:
> > +void
> > +default_print_patchable_function_entry (FILE *file,
> > + unsigned HOST_WIDE_INT patch_area_size,
> > + bool record_p)
> > +{
> > + static const char *nop_templ = 0;
>
> You need to record this pointer as a GC root. Otherwise garbage
> collection might destroy your template NOP.
I don't think so: get_insn_template() should always return strings in
.rodata, even for output statements, and should never point into GC
memory.
> > + /* We use the template alone, relying on the (currently sane) assumption
> > + that the NOP template does not have variable operands. */
> > + if (!nop_templ)
> > + {
> > + int code_num;
> > + rtx_insn *my_nop = make_insn_raw (gen_nop ());
> > +
> > + code_num = recog_memoized (my_nop);
> > + nop_templ = get_insn_template (code_num, my_nop);
> > + }
Ciao,
Michael.