[PATCH] D38819: [libunwind] Add support for dwarf unwinding on windows on x86_64

Martin Storsjö via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 23 03:08:49 PDT 2017


mstorsjo added inline comments.


================
Comment at: src/UnwindRegistersRestore.S:98
+  # skip fs
+  # skip gs
+  movq  56(%rcx), %rsp  # cut back rsp to new location
----------------
mstorsjo wrote:
> compnerd wrote:
> > Doesn't Win64 ABI require some of the MMX registers be saved/restored too?
> Right, yes, xmm6-xmm15 should be backed up and restored. I'll try to amend this with such a change.
Actually, such a change doesn't necessarily make much sense on its own.

As long as the dwarf encoding itself doesn't describe how to restore those registers (and on unix platforms you don't need to, so it probably isn't even specified), you'd just end up backing up the xmm registers on entry when throwing the exception, and restoring the exactly same ones again - it only guards against changes within libcxxabi/libunwind and the unwinding machinery itself, not against changes further down in the call stack between the thrower and catcher of the exception.

So with that, I guess this patch is futile unless planning to extend the x86_64 dwarf handling in llvm to include those registers as well - and that's a little out of scope of what I intended to do here...


https://reviews.llvm.org/D38819





More information about the cfe-commits mailing list