[LLVMdev] clang/g++ frontend: can __cxa_end_catch throw?

Yuri yuri at rawbw.com
Mon Jul 12 03:00:31 PDT 2010


On 07/12/2010 00:23, Duncan Sands wrote:
> IIRC, __cxa_end_catch may throw an exception because it runs the destructor
> for the exception object, which can execute arbitrary user code and thus may
> throw an exception.  This is why it is sometimes correct to use invoke for it.
> However in the case of your example it seems that llvm-gcc didn't optimize the
> code as well as it might, since the invoke is redundant.
>    

But there are cases when the outcomes will be different. In case of gcc 
frontend terminate() will be called when the original exception's 
destructor throws an exception and in case of clang 
Unwind_Resume_or_Rethrow will be called which is different.

I think one of these cases must be an incorrect behavior.

Yuri




More information about the llvm-dev mailing list