<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [X68] r270109 can create dead stack adjustments after noreturn calls (previously PR27140)"
href="https://bugs.llvm.org/show_bug.cgi?id=43155">43155</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[X68] r270109 can create dead stack adjustments after noreturn calls (previously PR27140)
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rnk@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>craig.topper@gmail.com, hans@chromium.org, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>Here is my gnarly C test case to make this happen on Linux:
__attribute__((noreturn)) void exit_manyarg(int, int, int, int, int, int, int,
int, int, int);
struct ByVal {
int vals[10];
};
struct ByVal getbyval();
void make_push_unprofitable(struct ByVal);
void bar();
extern int gv1, gv2, gv3, gv4, gv5, gv6, gv7, gv8, gv9, gv10;
int foo(int c) {
if (c)
exit_manyarg(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
make_push_unprofitable(getbyval());
make_push_unprofitable(getbyval());
make_push_unprofitable(getbyval());
return 0;
}
$ clang -S -O2 check.c --target=x86_64-linux -o - -fPIC
...
callq exit_manyarg@PLT
subq $32, %rsp
This only happens with a noreturn function has stack arguments, which is rare
for Linux. However for Win64, the caller must always reserve 32 bytes of stack
space. Currently this bug doesn't happen on Win64, but I plan to make it stop
setting TrapUnreachable, which will make it happen for all noreturn calls, and
then it will matter.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>