[PATCH] D34544: [libunwind] Don't assume the return address register is always saved and has CFI for it

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 17:16:48 PDT 2017


thegameg created this revision.

If we want to take shrink-wrapping to the next level, we will shrink-wrap the return address register, and realize that on some paths we don't actually need to save it.

In this case, libunwind fails to set IP to the return address, since there are no CFI directives on how to get its value in that IP range.

The following fix gets the return address from the current return address register, and if there are CFI directives for it, it will be overriden.

Not sure how libunwind is tested (it has only 4 tests in the test directory). Probably the test case can be reduced or dropped since it comes from the llvm test-suite.


https://reviews.llvm.org/D34544

Files:
  src/DwarfInstructions.hpp
  test/recursive-throw-shrink-wrap.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34544.103671.patch
Type: text/x-patch
Size: 9241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170623/28db518b/attachment.bin>


More information about the llvm-commits mailing list