[llvm-bugs] [Bug 27117] New: LLVM generates unreachable call stack adjustments after noreturn functions when the frame is not reserved
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Mar 29 11:26:35 PDT 2016
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: unassignedbugs at nondot.org
Reporter: rnk at google.com
CC: llvm-bugs at lists.llvm.org
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 at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160329/c800dada/attachment.html>
More information about the llvm-bugs
mailing list