<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - bad alignment for xmm constants due to conflicting COMDATs"
href="https://llvm.org/bugs/show_bug.cgi?id=26680">26680</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>bad alignment for xmm constants due to conflicting COMDATs
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>3.8
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>r.sagitario@gmx.de
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>With LLVM 3.8 for Win64, compile these three files with optimizations:
// a.cpp
double fun(double x)
{
return x > 1.0 ? 2.0 : 3.0;
}
// b.cpp
double goo(double* x)
{
x[0] += 3.0;
x[1] += 2.0;
return x[0] + x[1];
}
// m.cpp
double fun(double);
double goo(double*);
int main()
{
fun(1);
double x[2] = { 0, 0 };
return goo(x) > 0;
}
with "clang -O -m64 m.cpp a.cpp b.cpp".
The resulting executable crashes due to bad alignment for the
__xmm@40000000000000004008000000000000 constant. Both a.obj and b.obj define
the COMDAT. a.obj only requires alignment 8, but b.obj needs 16 byte alignment
for the 'addpd' instruction. The linker picks the one from a.obj.</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>