[llvm-bugs] [Bug 37870] New: __builtin_shuffle parsing bug
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Jun 19 23:41:12 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=37870
Bug ID: 37870
Summary: __builtin_shuffle parsing bug
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: zhonghao at pku.org.cn
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
The code is as follow:
typedef int V __attribute__((vector_size (16)));
V a, b, c;
int
foo ()
{
return __builtin_shuffle (a, b, c)[3];
}
int
main ()
{
a = (V) { 1, 2, 3, 4 };
b = (V) { 5, 6, 7, 8 };
c = (V) { 7, 2, 5, 6 };
if (foo () != 7)
__builtin_abort ();
return 0;
}
clang++ rejects the code with an error message:
error: use of undeclared identifier '__builtin_shuffle'
return __builtin_shuffle (a, b, c)[3];
^
1 error generated.
The code comes from a gcc bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78089
Jakub Jelinek explained why it is a bug.
--
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/20180620/4dc9665c/attachment.html>
More information about the llvm-bugs
mailing list