<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 - Invalid fastcc function signatures when inlining `this` into multiple parameters and there is inalloca parameters"
href="https://bugs.llvm.org/show_bug.cgi?id=38487">38487</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Invalid fastcc function signatures when inlining `this` into multiple parameters and there is inalloca parameters
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows XP
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ngg@tresorit.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The following code has an assertion failure:
fatal error: error in backend: any parameter with the inalloca attribute must
be the only memory argument
The bug is happening both with clang 6.0.1 and 7.0.0 RC1.
Compile with: clang++ -target i386-pc-windows-msvc -O3 -c x.cpp
The F::k function gets the following signature:
define internal fastcc void @"\01?k@F@?A@@QAEXUY@@@Z"(i32, i32, i32, <{
%struct.Y }>* inalloca) unnamed_addr #0 align 2
This is not callable because there cannot be any more memory arguments if there
is inalloca, and the 3 ints are too many to be passed in registers.
// x.cpp
// clang++ -target i386-pc-windows-msvc -O3 -c x.cpp
struct Y
{
int i;
Y();
Y(const Y&);
};
void h(Y y);
namespace {
struct F {
int i1, i2, i3;
void k(Y y) {
y.i = i1+i2+i3;
h(y);
}
};
}
void foo()
{
F f;
Y y;
f.k(y);
}</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>