[LLVMbugs] [Bug 22467] Win64 prologues with frame pointers must set RBP last

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 10 09:29:01 PST 2015


Reid Kleckner <rnk at google.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Reid Kleckner <rnk at google.com> ---
David fixed this in r228641. X86FrameLowering may be my least favorite class in
LLVM. Now we should emit prologues like GCC and MSVC when a frame pointer is

push %rbp
.seh_pushreg N
push %rbx
.seh_pushreg N
sub $320, %rsp
.seh_stackalloc 320
lea -128(%rsp), %rbp
.seh_setframe 5, 240

All offsets calculated via rbp have been updated to take into account the space
used by CSRs and the space used to do stackalloc.

One thing we don't account for is the "tail call return addr delta" which comes
into play when someone asks for guaranteed tail call optimization.

Another thing we'd like to do is make __builtin_frameaddress(0) /
llvm.frameaddress(i32 0) return "%rbp + 128" in this example to recover the
stack pointer when the FP was established. The raw value of RBP is not useful
for stack unwinding anymore, but the SP at the end of the prologue can be used
in combination with the xdata tables to unwind.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150210/7feafc1d/attachment.html>

More information about the llvm-bugs mailing list