PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Segfault on SSE intrinsic code

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Antti-Pekka Hynninen



Joined: 17 Aug 2012
Posts: 1

PostPosted: Fri Aug 17, 2012 9:40 am    Post subject: Segfault on SSE intrinsic code Reply with quote

Hi, the following very simple code segfaults in the kraken supercomputer. Compiled with:
"pgcc sse_test.c"
pgcc version:
pgcc 11.9-0 64-bit target on x86-64 Linux -tp k8e

sse_test.c:
--------------------
#include <stdio.h>
#include <math.h>

#ifdef __SSE2__
#include <emmintrin.h>
#endif
#if defined(__INTEL_COMPILER) && !defined(__SSE3__)
#define __SSE3__
#endif
#ifdef __SSE3__
#include <pmmintrin.h>
#endif

/*
Only difference between test_crash and test_ok is the location of the input parameter q1
*/

void test_crash(__m128d dx2, __m128d dy2, __m128d dz2, __m128d rsq2,
__m128d dx3, __m128d dy3, __m128d dz3, __m128d rsq3,
double *pftable,
double *forcexjj0, double *forceyjj0, double *forcezjj0,
double *forcexjj1, double *forceyjj1, double *forcezjj1,
__m128d q1
) {

printf("test_crash, Here (1)\n");

__m128d ep1 = _mm_set1_pd(1.0);

printf("test_crash, Here (2)\n");

__m128d coulpotd = _mm_mul_pd(q1, ep1);

printf("test_crash, Here (3)\n");

return;

}

void test_ok(__m128d dx2, __m128d dy2, __m128d dz2, __m128d rsq2,
__m128d dx3, __m128d dy3, __m128d dz3, __m128d rsq3,
double *pftable,
double *forcexjj0, double *forceyjj0, double *forcezjj0,
__m128d q1,
double *forcexjj1, double *forceyjj1, double *forcezjj1
) {

printf("test_ok, Here (1)\n");

__m128d ep1 = _mm_set1_pd(1.0);

printf("test_ok, Here (2)\n");

__m128d coulpotd = _mm_mul_pd(q1, ep1);

printf("test_ok, Here (3)\n");

return;

}


int main() {
double forcex;
double pftable;

__m128d dx2 = _mm_set1_pd(0.0);
__m128d dy2 = _mm_set1_pd(0.0);
__m128d dz2 = _mm_set1_pd(0.0);
__m128d rsq2 = _mm_set1_pd(0.0);

__m128d dx3 = _mm_set1_pd(0.0);
__m128d dy3 = _mm_set1_pd(0.0);
__m128d dz3 = _mm_set1_pd(0.0);
__m128d rsq3 = _mm_set1_pd(0.0);

__m128d qOOd = _mm_set1_pd(0.0);

test_ok(dx2, dy2, dz2, rsq2,
dx3, dy3, dz3, rsq3,
&pftable,
&forcex, &forcex, &forcex,
qOOd,
&forcex, &forcex, &forcex
);

test_crash(dx2, dy2, dz2, rsq2,
dx3, dy3, dz3, rsq3,
&pftable,
&forcex, &forcex, &forcex,
&forcex, &forcex, &forcex,
qOOd
);


return 1;
}
----------------
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6129
Location: The Portland Group Inc.

PostPosted: Fri Aug 17, 2012 2:18 pm    Post subject: Reply with quote

Hi Antti-Pekka Hynninen,

Thanks for the report. I've sent this on to our compiler engineers (TPR#18880) since I'm not sure why this is failing. Though, it does seem like a compiler issue.

Best Regards,
Mat
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 438

PostPosted: Tue May 21, 2013 6:39 pm    Post subject: TPR 18880 fixed in 12.10. Reply with quote

TPR 18880 - User code using m128 sse intrinsics gets segv in 11.10 and ICE in 12.x and dev

was fixed in the 12.10 release last October.

thanks,
dave
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group