[llvm-dev] Exception handling support for a target
陳韋任 via llvm-dev
llvm-dev at lists.llvm.org
Wed Jan 24 03:46:46 PST 2018
2018-01-24 0:23 GMT+08:00 Ben Craig <ben.craig at ni.com>:
> The high level of what happens is that __builtin_eh_return forces a spill
> of all the non-volatile registers. The unwinder then has a starting point
> for populating and adjusting those non-volatile registers.
>
>
>
> This approach usually requires that the function calling
> __builtin_eh_return be built without optimizations, because the optimizer
> will then remove the spills.
>
Ben, thanks for your input. However, I don't quite understand what you
said.
The prototype of __builtin_eh_return (offset, handler) [1], I can't see
why it forces spilling all non-volatile registers (I assume non-volatile ==
callee-saved).
Take libgcc as an example, __built_eh_return is called in
uw_install_context [1], which is called in the end of
_Unwind_RaiseException [2]. Do you mean we should compile libgcc without
optimization?
[1] https://github.com/gcc-mirror/gcc/blob/master/libgcc/unwind-dw2.c
[2] https://github.com/gcc-mirror/gcc/blob/master/libgcc/unwind.inc
--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180124/8e05e17b/attachment.html>
More information about the llvm-dev
mailing list