So far I am not seeing any architectures explicitly saving/restoring the STATIC_CHAIN_REGNUM as part of their prologue/epilogue. Is it enough to mark the STATIC_CHAIN_REGNUM in CALL_USED_REGISTERS ? On Thu, Apr 4, 2019 at 7:54 AM Florian Weimer <fweimer@xxxxxxxxxx> wrote: > > * William Tambe: > > > Does the prologue and epilogue need to save and restore STATIC_CHAIN_REGNUM ? > > or does GCC automatically takes care of it ? > > I don't think GCC will save it. It's a caller-saved register on some > architectures, after all (e.g. x86-64). > > Thanks, > Florian