Hi! On Mon, Aug 24, 2020 at 03:49:50PM -0500, Qing Zhao wrote: > > Do you want to do this before or after the epilogue code is generated? > > static rtx_insn * > make_epilogue_seq (void) > { > if (!targetm.have_epilogue ()) > return NULL; > > start_sequence (); > emit_note (NOTE_INSN_EPILOGUE_BEG); > > +++++ gen_call_used_regs_seq (); // this is the place to > emit the zeroing insn sequence > > rtx_insn *seq = targetm.gen_epilogue (); > … > } > > Any comment on this?
So, before. This is problematic if the epilogue uses any of those registers: if the epilogue expects some value there, you just destroyed it; and, conversely, if the epilogue writes such a reg, your zeroing is useless. You probably have to do this for every target separately? But it is not enough to handle it in the epilogue, you also need to make sure it is done on every path that returns *without* epilogue. Segher