Yuri
2010-Jul-15 22:31 UTC
[LLVMdev] Why clang++ doesn't set 'noreturn' flag on declarations of __cxa_throw and _Unwind_Resume_or_Rethrow ?
When I compile some code with the near-trunk clang++ I get this: ... tail call void @_Unwind_Resume_or_Rethrow(i8* %exn2) noreturn unreachable ... declare void @_Unwind_Resume_or_Rethrow(i8*) ... Same with __cxa_throw. 'noreturn' is missing on declarations. This seems to be a bug. Also can _Unwind_Resume_or_Rethrow actually return? When I run some simple exception code in JIT I see that this function actually returns and then SEGVs. Yuri
John McCall
2010-Jul-16 00:51 UTC
[LLVMdev] Why clang++ doesn't set 'noreturn' flag on declarations of __cxa_throw and _Unwind_Resume_or_Rethrow ?
On Jul 15, 2010, at 3:31 PM, Yuri wrote:> When I compile some code with the near-trunk clang++ I get this:Please send clang-specific questions to cfe-dev at cs.uiuc.edu.> ... > tail call void @_Unwind_Resume_or_Rethrow(i8* %exn2) noreturn > unreachable > ... > declare void @_Unwind_Resume_or_Rethrow(i8*) > ... > > Same with __cxa_throw. 'noreturn' is missing on declarations. > This seems to be a bug.It really shouldn't make a difference; the call site should take priority anyway.> Also can _Unwind_Resume_or_Rethrow actually return? When I run some > simple exception code in JIT I see that this function actually returns > and then SEGVs.I have no idea what system you're on, but _Unwind_Resume_or_Rethrow really isn't allowed to return. John.
Bill Wendling
2010-Jul-16 01:30 UTC
[LLVMdev] Why clang++ doesn't set 'noreturn' flag on declarations of __cxa_throw and _Unwind_Resume_or_Rethrow ?
On Jul 15, 2010, at 5:51 PM, John McCall wrote:>> Also can _Unwind_Resume_or_Rethrow actually return? When I run some >> simple exception code in JIT I see that this function actually returns >> and then SEGVs. > > I have no idea what system you're on, but _Unwind_Resume_or_Rethrow really > isn't allowed to return. >It's not. But if the unwind library can't handle something, then the _Unwind_Resume_or_Rethrow could fall out of the function (it would assert in debug mode). Darwin's implementation of _URoR in libunwind does this. -bw
Seemingly Similar Threads
- [LLVMdev] Why clang++ doesn't set 'noreturn' flag on declarations of __cxa_throw and _Unwind_Resume_or_Rethrow ?
- [LLVMdev] Why clang++ doesn't set 'noreturn' flag on declarations of __cxa_throw and _Unwind_Resume_or_Rethrow ?
- [LLVMdev] Why clang++ doesn't set 'noreturn' flag on declarations of __cxa_throw and _Unwind_Resume_or_Rethrow ?
- [LLVMdev] Why clang++ doesn't set 'noreturn' flag on declarations of __cxa_throw and _Unwind_Resume_or_Rethrow ?
- [LLVMdev] noreturn attribute on a call instruction vs noreturn on afunction