<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 - Crash with inline asm using wrong register name"
href="https://bugs.llvm.org/show_bug.cgi?id=48678">48678</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Crash with inline asm using wrong register name
</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>Linux
</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>Common Code Generator Code
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>paul_robinson@playstation.sony.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre><a href="https://godbolt.org/z/ne1j4h">https://godbolt.org/z/ne1j4h</a>
In a Release build (which is what godbolt has) the crash is in
pass 'Post-RA pseudo instruction expansion pass'.
In an Asserts build that I did myself, I get
clang:
/home/probinson/projects/llvm-org/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8072:
void GetRegistersForValue(llvm::SelectionDAG&, const llvm::SDLoc&,
{anonymous}::SDISelAsmOperandInfo&, {anonymous}::SDISelAsmOperandInfo&):
Assertion `I != RC->end() && "AssignedReg should be member of RC"' failed.
gcc 7.5 compiles it cleanly.
$ cat foo.c
typedef int __v8si __attribute__((__vector_size__(32)));
void foo(void) {
/* This should be "ymm15" but gcc accepts while clang asserts. */
register __v8si a asm("xmm15") = {
0x1234001,
0x1234002,
0x1234003,
0x1234004,
0x1234005,
0x1234006,
0x1234007,
0x1234008,
};
asm volatile ("traceme: call dummy" : : "x" (a));
}
$ gcc foo.c -c -mavx
$ clang foo.c -c -mavx
<crash></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>