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

When I compile some code with the near-trunk clang++ I get this:

Please send clang-specific questions to cfe-dev@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.

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

Isn't unwind library supposed to call terminate() every time it can't handle something?

Yuri

I don't see anything specifying that it should call terminate() in the exception ABI document:

  http://www.codesourcery.com/public/cxx-abi/abi-eh.html

-bw

If the unwind state is broken, we're well into who-really-cares-what-happens state. I
would abstractly prefer if URR just called abort() because it doesn't disguise the problem,
but whatever.

John.