https://bugs.llvm.org/show_bug.cgi?id=50449
Bug ID: 50449
Summary: allow indicating that calls to asm expressions are
[[noreturn]]
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected],
[email protected]
Example (minimized): https://gcc.godbolt.org/z/nqKq49q7a
[[noreturn]] void trap() {
asm volatile ("ret");
}
generates this LLVM-IR:
define dso_local void @_Z4trapv() #0 {
call void asm sideeffect "ret", "~{dirflag},~{fpsr},~{flags}"() #1,
!srcloc !4
ret void
}
attributes #0 = { noinline noreturn nounwind optnone uwtable mustprogress }
attributes #1 = { nounwind }
and there does not appear to be a way to add the LLVM-IR "noreturn" attribute
to the call such that #1 becomes:
attributes #1 = { nounwind noreturn }
There are a couple of ways in which this could be allowed, e.g.,:
- supporting: [[noreturn]] asm volatile(....)
- supporting: asm volatile(... : : : "noreturn")
If this is supported, both the LLVM-IR "call" or "invoke" instructions
generated should have the "noreturn" attribute.
Also, the warning produced:
warning: function declared 'noreturn' should not return
[-Winvalid-noreturn]
should probably be updated to take inline asm expressions that never return
into account.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs