https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67002
--- Comment #21 from Kazumoto Kojima <kkojima at gcc dot gnu.org> --- (In reply to Oleg Endo from comment #20) > Yes, that looks OK. treg_set_expr-something recog matching is actually only > required during combine. The simpler forms like (reg:SI T_REG) could also > be required during expansion. Thanks. I'll commit it when the usual test is done. > Hm ... actually it should work. The temporary rtx insn is not used for > anything else, so that assigned insn uid will never appear anywhere. > However, it's probably better to have one "static rtx_insn" to avoid > constructing the temporary rtx over and over again. Unfortunately the > gen_rtx* functions allocate rtx objects always on the GC heap. Yes, it works. I'm uncomfortable with it because the current use of crtl->emit.x_cur_insn_uid aka cur_insn_uid is limitted to emit-rtl.c. I think that the use of that field outside of emit-rtl.c is unexpected. Also it doesn't sound good to add a new interface to access that field there. After all, your "static rtx_insn" is the right thing to do.