[llvm-dev] LLVM EH tables much larger than GCC's

David Chisnall via llvm-dev llvm-dev at lists.llvm.org
Thu Jan 11 01:11:19 PST 2018


On 11 Jan 2018, at 02:36, Ryan Prichard via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> It seems that some unwinders still run cleanups when the termination landing pad is omitted?
> 
> e.g. For this sample code, GCC emits an empty call site table for func3:
> 
> #include <stdio.h>
> struct A { ~A() { fprintf(stderr, "~A\n"); } };
> void func1() { throw 0; }
> void func2() { A a; func1(); }
> void func3() noexcept { func2(); }
> int main() { func3(); }
> 
> Compiling for either x86 or x86_64 Ubuntu, using g++ with libstdc++/libsupc++, the program still calls ~A. On the other hand, ~A isn't called if I build with g++ and libc++/libc++abi.

Compiling with g++6 and linking with libc++/libcxxrt also runs the destructor, so this looks like a libc++abi bug.

David



More information about the llvm-dev mailing list