[llvm-bugs] [Bug 47782] New: [PowerPC] Clang accepts vector unsigned long long without VSX, miscompiles
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Oct 9 09:47:01 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=47782
Bug ID: 47782
Summary: [PowerPC] Clang accepts vector unsigned long long
without VSX, miscompiles
Product: clang
Version: trunk
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: hstong at ca.ibm.com
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
nemanja.i.ibm at gmail.com, richard-llvm at metafoo.co.uk
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:
https://godbolt.org/z/n5M1e8
### 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 (https://github.com/llvm/llvm-project.git
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
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201009/dd4b8615/attachment-0001.html>
More information about the llvm-bugs
mailing list