https://llvm.org/bugs/show_bug.cgi?id=23971
Bug ID: 23971
Summary: __attribute__((naked)) broken for possibly-returning
functions
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Naked functions get unreachable statement at the end, which may be propagated
into their callers.
# cat 1.c
__attribute__((naked,noinline)) void f() {
asm volatile("bx lr\n\t");
}
int g() {
f();
return 42;
}
# clang -c 1.c -S -emit-llvm -o - -O1
define void @f() #0 {
entry:
tail call void asm sideeffect "bx lr\0A\09", "~{dirflag},~{fpsr},~{flags}"()
#2, !srcloc !1
unreachable
}
; Function Attrs: noreturn nounwind uwtable
define i32 @g() #1 {
entry:
tail call void @f()
unreachable
}
"return 42" in g() is gone.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs