On Fri, Feb 16, 2024 at 02:23:54PM +0000, Maciej W. Rozycki wrote: > On Fri, 16 Feb 2024, Segher Boessenkool wrote: > > > > Conversely no heuristics is required to unwind VAX frames, because they > > > are fixed in layout by hardware, fully self-described, and with the > > > hardware frame pointer always available. > > > > The downside of the VAX situation of course is that the compiler has no > > freedom to optimise the frame and *logue code at all, let alone well. > > This may not matter so much on narrow ucoded in-order machines, there > > are different balances there :-) > > There is no function prologue to optimise in the VAX case, because all > the frame setup has already been made by the CALLS instruction itself in > the caller. The first machine instruction of the callee is technically > already past the "prologue". And then RET serves as the whole function > "epilogue".
So, what is the problem with DWARF unwinding? Just make sure to emit appropriate instructions describing the saving of the corresponding registers at specific points based on CFA at the start of the function (so that it appears in CIE instructions) and that should be all that is needed, no? Jakub