http://llvm.org/bugs/show_bug.cgi?id=19451
Bug ID: 19451
Summary: Crash Using Clang on Android
Product: clang
Version: 3.4
Hardware: Other
OS: other
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
On Android NDK 9 the following code will cause a crash using the bundled
clang3.4 with -mfpu=neon. It crashes in the creation of the vector of
intrinsics. It seems to work with the bundled gcc4.8.
#include <android/log.h>
#include <vector>
#include <arm_neon.h>
#define SIZE 1000
struct timeval start,end,diff;
int iterations=1000;
float final_sum;
std::vector<float32x4_t> vectors;
const float32_t sum_scalar[4] = { 0,0,0,0 };
float32x4_t sum = vld1q_f32(sum_scalar);
for(int i=0;i<SIZE;i++){
const float32_t v_scalar[4] = {
(float)rand()/RAND_MAX,(float)rand()/RAND_MAX,(float)rand()/RAND_MAX,0 };
float32x4_t vec = vld1q_f32(v_scalar);
vectors.push_back(vec);
}
gettimeofday(&start,NULL);
for(int k=0;k<iterations;k++) for(int i=0;i<SIZE;i++) for(int j=0;j<SIZE;j++)
sum=vaddq_f32(sum,vectors[j]);
final_sum = vget_lane_f32(sum,0) + vget_lane_f32(sum,1) +
vget_lane_f32(sum,2);
gettimeofday(&end,NULL);
timersub(&end,&start,&diff);
float timePassed=diff.tv_sec+diff.tv_usec/1000000.f;
__android_log_print(ANDROID_LOG_VERBOSE, "NEON", "Sum %f",final_sum);
__android_log_print(ANDROID_LOG_VERBOSE, "NEON", "Time %f",timePassed);
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs