[LLVMbugs] [Bug 23414] New: [AArch64]Clang crush on an assertion when calling a NEON intrinsic with incorrect type in CPP file
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon May 4 19:49:46 PDT 2015
https://llvm.org/bugs/show_bug.cgi?id=23414
Bug ID: 23414
Summary: [AArch64]Clang crush on an assertion when calling a
NEON intrinsic with incorrect type in CPP file
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: Hao.Liu at arm.com
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
The test case is test.cpp
------------------------------------
#include <arm_neon.h>
int8x8_t test_vadd_s8(int8x16_t v1, int8x16_t v2) {
// int8x8_t vadd_s8(int8x8_t a, int8x8_t b)
return vadd_s8(v1, v2);
}
int8x8x2_t test_vld2_s8(float *a) {
// int8x8x2_t vld2_s8(int8_t const * ptr)
return vld2_s8(a);
}
------------------------------------
To reproduce the crush:
$clang -S -O3 -target aarch64 test.cpp
unexpected Neon polynomial vector element type
UNREACHABLE executed at
/home/haoliu01/hd/src/repo/clang/lib/AST/ItaniumMangle.cpp:2317!
#0 0x26620c5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/haoliu01/hd/src/repo/llvm/lib/Support/Unix/Signals.inc:431:0
#1 0x26623da PrintStackTraceSignalHandler(void*)
/home/haoliu01/hd/src/repo/llvm/lib/Support/Unix/Signals.inc:489:0
But the C file test.c with the same code as test.cpp can report error/warning
correctly:
$clang -S -O3 -target aarch64 test.c
test.c:5:18: error: passing 'int8x16_t' (vector of 16 'int8_t' values) to
parameter of incompatible type
'int8x8_t' (vector of 8 'int8_t' values)
return vadd_s8(v1, v2);
^~
/home/haoliu01/hd/src/repo/build/bin/../lib/clang/3.7.0/include/arm_neon.h:1077:32:
note: passing argument to
parameter '__p0' here
__ai int8x8_t vadd_s8(int8x8_t __p0, int8x8_t __p1) {
^
test.c:10:18: warning: incompatible pointer types assigning to 'const signed
char *' from 'float *'
[-Wincompatible-pointer-types]
return vld2_s8(a);
^
/home/haoliu01/hd/src/repo/build/bin/../lib/clang/3.7.0/include/arm_neon.h:8949:33:
note: expanded from macro
'vld2_s8'
__builtin_neon_vld2_v(&__ret, __p0, 0); \
^
1 warning and 1 error generated.
Also, GCC can report errors (I used the linaro toolchain):
$aarch64-linux-gnu-g++ -O3 -S test.cpp
test.cpp: In function ‘int8x8_t test_vadd_s8(int8x16_t, int8x16_t)’:
test.cpp:5:24: error: cannot convert ‘int8x16_t {aka __vector(16)
__builtin_aarch64_simd_qi}’ to ‘int8x8_t {aka __vector(8)
__builtin_aarch64_simd_qi}’ for argument ‘1’ to ‘int8x8_t vadd_s8(int8x8_t,
int8x8_t)’
return vadd_s8(v1, v2);
^
test.cpp: In function ‘int8x8x2_t test_vld2_s8(float*)’:
test.cpp:10:19: error: cannot convert ‘float*’ to ‘const int8_t* {aka const
signed char*}’ for argument ‘1’ to ‘int8x8x2_t vld2_s8(const int8_t*)’
return vld2_s8(a);
^
--
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/20150505/9cc356d3/attachment.html>
More information about the llvm-bugs
mailing list