-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed as not planned
Labels
clangClang issues not falling into any other categoryClang issues not falling into any other categoryobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM
Description
__attribute__((__noreturn__)) is miscompiled upstream.
See https://godbolt.org/z/T6nMoa75G from Miguel Young and his comment.
When using the standard [[noreturn]] and _Noreturn in their respective languages, codegen is identical, and correct. The C codegen is obviously wrong and clearly confusing the hell out of LLVM, as evidenced by this instruction sequence:
jne .LBB1_1
mov rax, qword ptr [rip + baz@GOTPCREL]
call rax
.LBB1_1: mov rax, qword ptr [rip + foo@GOTPCREL] call rax
(Just do call foo@PLT?)
My recommendation is that upstream use _Noreturn, or noreturn + <stdnoreturn.h>. Clang is clearly able to get this right, but somehow left hand isn't talking to right hand in the unification algorithm.
(This really isn't a C v. C++ difference at all; both languages define their standard noreturn primitives identically.)
Metadata
Metadata
Assignees
Labels
clangClang issues not falling into any other categoryClang issues not falling into any other categoryobsoleteIssues with old (unsupported) versions of LLVMIssues with old (unsupported) versions of LLVM