[PATCH] D38253: [ARM] Restore the right frame pointer register in Int_eh_sjlj_longjmp

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 13:02:24 PDT 2017


mstorsjo created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.

In setupEntryBlockAndCallSites in CodeGen/SjLjEHPrepare.cpp, we fetch and store the actual frame pointer, but on return via the longjmp intrinsic, it always was restored into the r7 variable.

On windows, the frame pointer should be restored into r11 instead of r7.

On Darwin (where sjlj exception handling is used by default), the frame pointer is always r7, both in arm and thumb mode, and likewise, on windows, the frame pointer always is r11.

On linux however, if sjlj exception handling is enabled (which it isn't by default), libcxxabi and the user code can be built in differing modes using different registers as frame pointer. Therefore, when restoring registers on a platform where we don't always use the same register depending on code mode, restore both r7 and r11.


https://reviews.llvm.org/D38253

Files:
  lib/Target/ARM/ARMAsmPrinter.cpp
  test/CodeGen/ARM/setjmp_longjmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38253.116597.patch
Type: text/x-patch
Size: 4358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170925/453e5651/attachment.bin>


More information about the llvm-commits mailing list