https://llvm.org/bugs/show_bug.cgi?id=27117
Bug ID: 27117
Summary: LLVM generates unreachable call stack adjustments
after noreturn functions when the frame is not
reserved
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: Common Code Generator Code
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Blocks: 26299
Classification: Unclassified
Consider:
__declspec(noreturn) void crash(void *);
void g(void*);
void f(int c) {
void *p = _alloca(c);
if (c)
crash(p);
g(p);
}
Here is the call to 'crash':
.LBB0_1: # %if.then
callq "?crash@@YAXPEAX@Z"
addq $32, %rsp
ud2
The ADD RSP instruction is dead. On Windows, it is very common to not have a
reserved call frame because of inalloca.
Maybe the right fix here is to teach MI more about noreturn functions so we can
do more general DCE after them. It would also help us get rid of
TrapOnUnreachable in favor of inserting int3 after all noreturn calls.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs