<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 - [PowerPC] Clang accepts vector unsigned long long without VSX, miscompiles"
href="https://bugs.llvm.org/show_bug.cgi?id=47782">47782</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[PowerPC] Clang accepts vector unsigned long long without VSX, miscompiles
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hstong@ca.ibm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, neeilans@live.com, nemanja.i.ibm@gmail.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>GCC treats vector unsigned long long and friends as invalid for AltiVec without
VSX. Clang fails to do so and also fails to use the correct calling convention
when building without VSX.
Compiler Explorer link:
<a href="https://godbolt.org/z/n5M1e8">https://godbolt.org/z/n5M1e8</a>
### SOURCE (<stdin>):
double f(vector unsigned long long);
double g(vector unsigned long long *p) {
return f(*p);
}
### COMPILER INVOCATION:
clang -target powerpc64-unknown-linux-gnu -Wall -Wextra -pedantic-errors -O3
-mcpu=power6 -S -o - -xc -
### ACTUAL ASSEMBLY OUTPUT (snippet):
ld 4, 8(3)
ld 3, 0(3)
bl f
### EXPECTED OUTPUT:
(error message)
### CORRECT VSX ASSEMBLY OUTPUT (snippet):
lxvd2x 34, 0, 3
bl f
### COMPILER VERSION INFO (clang -v):
clang version 12.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
68e1a8d20795802077987529e1268c184d749564)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/wandbox/clang-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64</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>